diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-10-30 11:53:10 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-10-30 12:20:42 +0100 |
commit | 2febb50a92adb91e88825a7839c1f055c10ba6cf (patch) | |
tree | ee503dbabd2a58f64fd830491859bf51788e6272 /src | |
parent | e679925bd0c8608ebe24f34917347ad939c6506d (diff) |
rest: do not remove image on center delete
if center is removed, leave images in place, image belongs to
repository, not to center.
This comes from b4870733 ('#942 Add REST POST /center/delete method')
Diffstat (limited to 'src')
-rw-r--r-- | src/rest.c | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -4704,7 +4704,6 @@ static int og_cmd_post_center_delete(json_t *element, const char *key, *msglog; struct og_dbi *dbi; dbi_result result; - uint32_t image_id; json_t *value; int err = 0; @@ -4749,32 +4748,6 @@ static int og_cmd_post_center_delete(json_t *element, dbi_result_free(result); - result = dbi_conn_queryf(dbi->conn, - "SELECT idimagen FROM imagenes WHERE idcentro=%s", - params->id); - - if (!result) { - dbi_conn_error(dbi->conn, &msglog); - syslog(LOG_ERR, "failed to query database (%s:%d) %s\n", - __func__, __LINE__, msglog); - og_dbi_close(dbi); - return -1; - } - - while (dbi_result_next_row(result)) { - image_id = dbi_result_get_uint(result, "idimagen"); - - err = og_dbi_delete_image(dbi, image_id); - if (err < 0) { - dbi_result_free(result); - og_dbi_close(dbi); - return err; - } - } - - dbi_result_free(result); - og_dbi_close(dbi); - return 0; } |