summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-20 22:15:25 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-20 22:15:25 +0200
commit4913f563537f78215b7512fad7f41ef971bc3e97 (patch)
tree6ea3211685029f63738a42f4dc2fc6574087a80e /src/backend
parenta01d45c4f35aa5195af542cdc2244f4940667d21 (diff)
downloadmerchant-4913f563537f78215b7512fad7f41ef971bc3e97.tar.gz
merchant-4913f563537f78215b7512fad7f41ef971bc3e97.tar.bz2
merchant-4913f563537f78215b7512fad7f41ef971bc3e97.zip
work on /products and /instances C API
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/taler-merchant-httpd_private-get-products.c14
-rw-r--r--src/backend/taler-merchant-httpd_private-patch-products-ID.c1
2 files changed, 4 insertions, 11 deletions
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);
{