From 149d1af21a9d8348cd504b21ad29fd2d742e8f77 Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Thu, 11 Jan 2024 13:09:05 +0100 Subject: rest: Change room field 'group' to 'folder_id' Change the name of variable 'group', in og_group struct, to 'folder_id'. Change payload field to 'folder_id' These changes are to make code easier to understand. --- src/dbi.h | 2 +- src/rest.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/dbi.h b/src/dbi.h index 37ecf2b..0bbb4e2 100644 --- a/src/dbi.h +++ b/src/dbi.h @@ -100,7 +100,7 @@ struct og_computer { struct og_room { uint32_t id; uint32_t center; - uint32_t group; + uint32_t folder_id; char location[OG_DB_ROOM_LOC_MAXLEN + 1]; char name[OG_DB_ROOM_NAME_MAXLEN + 1]; char gateway[OG_DB_IP_MAXLEN + 1]; diff --git a/src/rest.c b/src/rest.c index 5bafb4c..be92fa9 100644 --- a/src/rest.c +++ b/src/rest.c @@ -5988,8 +5988,8 @@ static int og_cmd_post_room_add(json_t *element, } else if (!strcmp(key, "center")) { err = og_json_parse_uint(value, &room.center); params->flags |= OG_REST_PARAM_CENTER; - } else if (!strcmp(key, "group")) { - err = og_json_parse_uint(value, &room.group); + } else if (!strcmp(key, "folder_id")) { + err = og_json_parse_uint(value, &room.folder_id); } else if (!strcmp(key, "remote")) { err = og_json_parse_bool(value, &room.remote); } @@ -6047,7 +6047,7 @@ static int og_cmd_post_room_add(json_t *element, "%d, '%s', '%s', %d, '%s', " "'%s', '%s', '%s', %d)", room.center, room.name, room.netmask, - room.group, room.location, room.gateway, + room.folder_id, room.location, room.gateway, room.dns, room.ntp, room.remote); if (!result) { -- cgit v1.2.3-18-g5258