diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-02-21 18:03:17 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-02-21 18:03:27 +0100 |
commit | 7aace51b40c2b63a64aa5d0e7f66b9819b0a07f6 (patch) | |
tree | ba8d12a20f151e5ca3be14bf14fdd2b52a017728 | |
parent | 9e92dc1004bedde592b14ad4a50071562a90ddd8 (diff) |
make pos_algo optional
-rw-r--r-- | src/backend/taler-merchant-httpd_private-patch-templates-ID.c | 5 | ||||
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-templates.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/taler-merchant-httpd_private-patch-templates-ID.c b/src/backend/taler-merchant-httpd_private-patch-templates-ID.c index 52a21b57..50bd8928 100644 --- a/src/backend/taler-merchant-httpd_private-patch-templates-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-templates-ID.c @@ -113,8 +113,9 @@ TMH_private_patch_templates_ID (const struct TMH_RequestHandler *rh, struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("template_description", (const char **) &tp.template_description), - GNUNET_JSON_spec_uint32 ("pos_algorithm", - &pos_algorithm), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_uint32 ("pos_algorithm", + &pos_algorithm)), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("pos_key", (const char **) &tp.pos_key), diff --git a/src/backend/taler-merchant-httpd_private-post-templates.c b/src/backend/taler-merchant-httpd_private-post-templates.c index 2ed76940..96bc0a7a 100644 --- a/src/backend/taler-merchant-httpd_private-post-templates.c +++ b/src/backend/taler-merchant-httpd_private-post-templates.c @@ -67,14 +67,15 @@ TMH_private_post_templates (const struct TMH_RequestHandler *rh, struct TALER_MERCHANTDB_TemplateDetails tp = { 0 }; const char *template_id; enum GNUNET_DB_QueryStatus qs; - uint32_t pos_algorithm; + uint32_t pos_algorithm = 0; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("template_id", &template_id), GNUNET_JSON_spec_string ("template_description", (const char **) &tp.template_description), - GNUNET_JSON_spec_uint32 ("pos_algorithm", - &pos_algorithm), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_uint32 ("pos_algorithm", + &pos_algorithm)), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("pos_key", (const char **) &tp.pos_key), |