summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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);