From 4913f563537f78215b7512fad7f41ef971bc3e97 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 20 Apr 2020 22:15:25 +0200 Subject: work on /products and /instances C API --- src/backend/taler-merchant-httpd_private-get-products.c | 14 +++----------- .../taler-merchant-httpd_private-patch-products-ID.c | 1 + 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'src/backend') diff --git a/src/backend/taler-merchant-httpd_private-get-products.c b/src/backend/taler-merchant-httpd_private-get-products.c index 21729a59..00b04636 100644 --- a/src/backend/taler-merchant-httpd_private-get-products.c +++ b/src/backend/taler-merchant-httpd_private-get-products.c @@ -27,14 +27,10 @@ * * @param cls a `json_t *` JSON array to build * @param product_id ID of the product - * @param in_stock how many are currently in stock (possibly locked), -1 for infinite - * @param unit in which unit is the stock measured in */ static void add_product (void *cls, - const char *product_id, - long long in_stock, - const char *unit) + const char *product_id) { json_t *pa = cls; @@ -42,13 +38,9 @@ add_product (void *cls, json_array_append_new ( pa, json_pack ( - "{s:s, s:I, s:s}", + "{s:s}", "product_id", - product_id, - "stock", - (json_int_t) in_stock, - "unit", - unit))); + product_id))); } diff --git a/src/backend/taler-merchant-httpd_private-patch-products-ID.c b/src/backend/taler-merchant-httpd_private-patch-products-ID.c index 6821d3d3..6ffc73fd 100644 --- a/src/backend/taler-merchant-httpd_private-patch-products-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-products-ID.c @@ -150,6 +150,7 @@ TMH_private_patch_products_ID (const struct TMH_RequestHandler *rh, GNUNET_JSON_spec_end () }; + pd.total_sold = 0; /* will be ignored anyway */ GNUNET_assert (NULL != mi); GNUNET_assert (NULL != product_id); { -- cgit v1.2.3