mirror of https://git.48k.eu/ogserver
rest: use json integer for repository id instead of string
use integer not string, it breaks backwards compatibility.master
parent
d383ff1c1a
commit
1d64b21241
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue