From cf7d0742a3368321310290c256a8b63827640b8c Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 29 Jun 2021 10:13:05 +0200 Subject: Fix procedure id retrieving in steps creation Otherwise, procedure id is always zero. Fixes: 1fdb7e6d1cf0709b1079b2d9990c0d53d8740461 --- src/rest.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rest.c b/src/rest.c index e66d613..54b5098 100644 --- a/src/rest.c +++ b/src/rest.c @@ -4079,7 +4079,6 @@ static int og_cmd_post_center_delete(json_t *element, int og_procedure_add_steps(struct og_dbi *dbi, struct og_procedure *proc) { struct og_procedure_step *step; - uint64_t procedure = 0; const char *legacy_params; const char *msglog; dbi_result result; @@ -4098,7 +4097,7 @@ int og_procedure_add_steps(struct og_dbi *dbi, struct og_procedure *proc) "INSERT INTO procedimientos_acciones " "(idprocedimiento, orden, parametros) " "VALUES (%d, %d, '%s')", - procedure, + proc->id, step->position, legacy_params); if (!result) { @@ -4119,7 +4118,7 @@ int og_procedure_add_steps(struct og_dbi *dbi, struct og_procedure *proc) "INSERT INTO procedimientos_acciones " "(idprocedimiento, orden, procedimientoid) " "VALUES (%d, %d, %d)", - procedure, + proc->id, step->position, step->procedure.id); if (!result) { -- cgit v1.2.3-18-g5258