diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2021-06-29 10:13:05 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-06-29 11:48:28 +0200 |
commit | cf7d0742a3368321310290c256a8b63827640b8c (patch) | |
tree | f2d2804ca0bcfdbcaf5eb3f2dbc7d84d182f852d | |
parent | 66ba6d045e02db4654dcd9dd25c5780179f57875 (diff) |
Fix procedure id retrieving in steps creation
Otherwise, procedure id is always zero.
Fixes: 1fdb7e6d1cf0709b1079b2d9990c0d53d8740461
-rw-r--r-- | src/rest.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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) { |