rest: use integer for server id

id is not a string, use integer instead
master v1.2.5-18
OpenGnSys Support Team 2024-09-03 14:13:30 +02:00
parent 38076677c7
commit 7977711ee9
1 changed files with 4 additions and 3 deletions

View File

@ -7979,11 +7979,12 @@ static int og_cmd_delete_server(json_t *element,
struct og_dbi *dbi; struct og_dbi *dbi;
dbi_result result; dbi_result result;
json_t *value; json_t *value;
uint32_t id;
int err = 0; int err = 0;
json_object_foreach(element, key, value) { json_object_foreach(element, key, value) {
if (!strcmp(key, "id")) { if (!strcmp(key, "id")) {
err = og_json_parse_string(value, &params->id); err = og_json_parse_uint(value, &id);
params->flags |= OG_REST_PARAM_ID; params->flags |= OG_REST_PARAM_ID;
} }
@ -8002,8 +8003,8 @@ static int og_cmd_delete_server(json_t *element,
} }
result = dbi_conn_queryf(dbi->conn, result = dbi_conn_queryf(dbi->conn,
"DELETE FROM entornos WHERE identorno='%s'", "DELETE FROM entornos WHERE identorno='%u'",
params->id); id);
if (!result) { if (!result) {
dbi_conn_error(dbi->conn, &msglog); dbi_conn_error(dbi->conn, &msglog);