From 892f0491356910aed30de4946878e3ff2a81abe9 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Fri, 9 Feb 2024 11:33:23 +0100 Subject: 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. --- src/rest.c | 4 ++-- 1 file 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); -- cgit v1.2.3-18-g5258