diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-06-20 15:19:55 +0200 |
---|---|---|
committer | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-06-20 16:07:53 +0200 |
commit | ce4eb4d83311d71d05ccd925912c417bbf761b9c (patch) | |
tree | a728864fcea7468994ad5612b041642fed5d728f /src/rest.c | |
parent | 30d6af09d5db938612b6ea803c5f88ea531cf7b7 (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")
Diffstat (limited to 'src/rest.c')
-rw-r--r-- | src/rest.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |