summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-02-09 11:33:23 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-02-13 12:14:24 +0100
commit892f0491356910aed30de4946878e3ff2a81abe9 (patch)
tree681f0d519323c144c439455931a651fb2dbaac4f
parente3a9814167cca4926aa255f5020b19e808b9acfa (diff)
rest: allow room update keeping the same name
Fix the code tha checked the existence of other rooms with the same name in the center but only check the rooms other than the one being updated.
-rw-r--r--src/rest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rest.c b/src/rest.c
index ddaa0dd..cf572bd 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -6308,8 +6308,8 @@ static int og_cmd_post_room_update(json_t *element,
result = dbi_conn_queryf(dbi->conn,
"SELECT nombreaula FROM aulas "
- "WHERE nombreaula='%s' AND idcentro=%d",
- room.name, room.center);
+ "WHERE nombreaula='%s' AND idcentro=%d AND idaula<>'%u'",
+ room.name, room.center, room.id);
if (!result) {
dbi_conn_error(dbi->conn, &msglog);