From ce4eb4d83311d71d05ccd925912c417bbf761b9c Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Mon, 20 Jun 2022 15:19:55 +0200 Subject: #915 Fix missing id on image creation On image creation, ogServer always sends 0 as image id to clients. When clients sends the response to the "create image" command with new information to update the image's entry in the database, the image id is 0 and ogServer fails to update the image's entry. This patch fixes this, assigning the correct id of the image. Fixes: d2f20d0be0661 ("#942 Create DB image when calling POST /image/create") --- src/rest.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/rest.c b/src/rest.c index f539426..65cdf56 100644 --- a/src/rest.c +++ b/src/rest.c @@ -2223,6 +2223,7 @@ static int og_cmd_create_image(json_t *element, struct og_msg_params *params) snprintf(new_image_id, sizeof(new_image_id), "%u", err); params->id = new_image_id; + json_object_set_new(element, "id", json_string(params->id)); } clients = json_copy(element); -- cgit v1.2.3-18-g5258