summaryrefslogtreecommitdiff
path: root/src/backenddb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-04-16 23:32:58 +0200
committerChristian Grothoff <christian@grothoff.org>2021-04-16 23:32:58 +0200
commit843f00401878a2db69cea3d3a5f72f27bd763070 (patch)
tree7d4c0d51340c9db76c4e6fad3e826751d904bd9d /src/backenddb
parenta7cc5eb7feda16ff48d3ca51514a1ae960bccd11 (diff)
downloadmerchant-843f00401878a2db69cea3d3a5f72f27bd763070.tar.gz
merchant-843f00401878a2db69cea3d3a5f72f27bd763070.tar.bz2
merchant-843f00401878a2db69cea3d3a5f72f27bd763070.zip
correct (product) image to be a string (as specified) instead of a JSON object
Diffstat (limited to 'src/backenddb')
-rw-r--r--src/backenddb/merchantdb_helper.c5
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/src/backenddb/merchantdb_helper.c b/src/backenddb/merchantdb_helper.c
index 516a5788..5a121287 100644
--- a/src/backenddb/merchantdb_helper.c
+++ b/src/backenddb/merchantdb_helper.c
@@ -24,13 +24,14 @@
void
-TALER_MERCHANTDB_product_details_free (struct TALER_MERCHANTDB_ProductDetails *pd)
+TALER_MERCHANTDB_product_details_free (
+ struct TALER_MERCHANTDB_ProductDetails *pd)
{
GNUNET_free (pd->description);
json_decref (pd->description_i18n);
GNUNET_free (pd->unit);
json_decref (pd->taxes);
- json_decref (pd->image);
+ GNUNET_free (pd->image);
json_decref (pd->address);
}
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index e39d8498..0170767d 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -986,8 +986,8 @@ postgres_lookup_product (void *cls,
&pd->total_sold),
GNUNET_PQ_result_spec_uint64 ("total_lost",
&pd->total_lost),
- TALER_PQ_result_spec_json ("image",
- &pd->image),
+ GNUNET_PQ_result_spec_string ("image",
+ &pd->image),
TALER_PQ_result_spec_json ("address",
&pd->address),
GNUNET_PQ_result_spec_absolute_time ("next_restock",
@@ -1059,7 +1059,7 @@ postgres_insert_product (void *cls,
GNUNET_PQ_query_param_string (pd->description),
TALER_PQ_query_param_json (pd->description_i18n),
GNUNET_PQ_query_param_string (pd->unit),
- TALER_PQ_query_param_json (pd->image),
+ GNUNET_PQ_query_param_string (pd->image),
TALER_PQ_query_param_json (pd->taxes),
TALER_PQ_query_param_amount (&pd->price),
GNUNET_PQ_query_param_uint64 (&pd->total_stock),
@@ -1107,7 +1107,7 @@ postgres_update_product (void *cls,
GNUNET_PQ_query_param_string (pd->description),
TALER_PQ_query_param_json (pd->description_i18n),
GNUNET_PQ_query_param_string (pd->unit),
- TALER_PQ_query_param_json (pd->image), /* $6 */
+ GNUNET_PQ_query_param_string (pd->image), /* $6 */
TALER_PQ_query_param_json (pd->taxes),
TALER_PQ_query_param_amount (&pd->price),
GNUNET_PQ_query_param_uint64 (&pd->total_stock),