summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-06-20 15:19:55 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-06-20 16:07:53 +0200
commitce4eb4d83311d71d05ccd925912c417bbf761b9c (patch)
treea728864fcea7468994ad5612b041642fed5d728f
parent30d6af09d5db938612b6ea803c5f88ea531cf7b7 (diff)
#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")
-rw-r--r--src/rest.c1
1 files changed, 1 insertions, 0 deletions
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);