diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rest.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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, ¶ms->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); |