summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-templates-ID.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-12-29 14:47:17 +0100
committerChristian Grothoff <christian@grothoff.org>2022-12-29 14:47:17 +0100
commit2c19f6a6fb180f059fcaeb193dd387c4d6af21b1 (patch)
treed7fdd874e84950510f5a7a698007023ed46d80ea /src/backend/taler-merchant-httpd_private-get-templates-ID.c
parent689bbc7a201067815cb0975703422854099d19ba (diff)
downloadmerchant-2c19f6a6fb180f059fcaeb193dd387c4d6af21b1.tar.gz
merchant-2c19f6a6fb180f059fcaeb193dd387c4d6af21b1.tar.bz2
merchant-2c19f6a6fb180f059fcaeb193dd387c4d6af21b1.zip
-towards fixing the template tests
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-templates-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-get-templates-ID.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-templates-ID.c b/src/backend/taler-merchant-httpd_private-get-templates-ID.c
index 76e28fac..be5359f8 100644
--- a/src/backend/taler-merchant-httpd_private-get-templates-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-templates-ID.c
@@ -33,8 +33,8 @@
*/
MHD_RESULT
TMH_private_get_templates_ID (const struct TMH_RequestHandler *rh,
- struct MHD_Connection *connection,
- struct TMH_HandlerContext *hc)
+ struct MHD_Connection *connection,
+ struct TMH_HandlerContext *hc)
{
struct TMH_MerchantInstance *mi = hc->instance;
struct TALER_MERCHANTDB_TemplateDetails tp = { 0 };
@@ -42,9 +42,9 @@ TMH_private_get_templates_ID (const struct TMH_RequestHandler *rh,
GNUNET_assert (NULL != mi);
qs = TMH_db->lookup_template (TMH_db->cls,
- mi->settings.id,
- hc->infix,
- &tp);
+ mi->settings.id,
+ hc->infix,
+ &tp);
if (0 > qs)
{
GNUNET_break (0);
@@ -68,8 +68,9 @@ TMH_private_get_templates_ID (const struct TMH_RequestHandler *rh,
MHD_HTTP_OK,
GNUNET_JSON_pack_string ("template_description",
tp.template_description),
- GNUNET_JSON_pack_string ("image",
- tp.image),
+ GNUNET_JSON_pack_allow_null (
+ GNUNET_JSON_pack_string ("image",
+ tp.image)),
GNUNET_JSON_pack_object_steal ("template_contract",
tp.template_contract));
GNUNET_free (tp.template_description);