#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: d2f20d0be0 ("#942 Create DB image when calling POST /image/create")
master
Javier Sánchez Parra 2022-06-20 15:19:55 +02:00
parent 30d6af09d5
commit ce4eb4d833
1 changed files with 1 additions and 0 deletions

View File

@ -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);