summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-08-21 16:23:47 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-08-21 21:33:46 +0200
commit1d64b212418ef96499224ac33bc28ee141bde8dd (patch)
treec8d30f124a00bafd9efd7fe68dc886e4af262a5e /src
parentd383ff1c1a7c52efcae767ab866389b507077b35 (diff)
rest: use json integer for repository id instead of string
use integer not string, it breaks backwards compatibility.
Diffstat (limited to 'src')
-rw-r--r--src/rest.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rest.c b/src/rest.c
index 2c1018c..20b241e 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -7031,7 +7031,7 @@ static int og_cmd_post_repository_update(json_t *element,
int err = 0;
json_object_foreach(element, key, value) {
- if (!strcmp(key, "repo_id")) {
+ if (!strcmp(key, "id")) {
err = og_json_parse_uint(value, &repo_id);
params->flags |= OG_REST_PARAM_ID;
}
@@ -7163,12 +7163,13 @@ static int og_cmd_post_repository_delete(json_t *element,
const char *key, *msglog;
struct og_dbi *dbi;
dbi_result result;
+ uint32_t repo_id;
json_t *value;
int err = 0;
json_object_foreach(element, key, value) {
if (!strcmp(key, "id")) {
- err = og_json_parse_string(value, &params->id);
+ err = og_json_parse_uint(value, &repo_id);
params->flags |= OG_REST_PARAM_ID;
}
if (err < 0)
@@ -7187,8 +7188,8 @@ static int og_cmd_post_repository_delete(json_t *element,
result = dbi_conn_queryf(dbi->conn,
"DELETE FROM repositorios "
- "WHERE idrepositorio=%s",
- params->id);
+ "WHERE idrepositorio=%u",
+ repo_id, repo_id);
if (!result) {
dbi_conn_error(dbi->conn, &msglog);