diff options
author | priscilla <priscilla.huang@efrei.net> | 2023-02-20 04:40:12 -0500 |
---|---|---|
committer | priscilla <priscilla.huang@efrei.net> | 2023-02-20 12:19:40 -0500 |
commit | 83c11d7428c6d4ba2e1749630724c39811a24241 (patch) | |
tree | f9b51c1c2b718166185a8d5338d21271996c2358 /src/backend | |
parent | 69341625aad4b0a1b3642103226f11c2ec4d943c (diff) |
pull changes
Diffstat (limited to 'src/backend')
3 files changed, 8 insertions, 31 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 953582ca..f15a03f8 100644 --- a/src/backend/taler-merchant-httpd_private-get-templates-ID.c +++ b/src/backend/taler-merchant-httpd_private-get-templates-ID.c @@ -69,12 +69,12 @@ TMH_private_get_templates_ID (const struct TMH_RequestHandler *rh, GNUNET_JSON_pack_string ("template_description", tp.template_description), GNUNET_JSON_pack_allow_null ( - GNUNET_JSON_pack_string ("image", - tp.image)), + GNUNET_JSON_pack_string ("pos_key", + tp.pos_key)), GNUNET_JSON_pack_object_steal ("template_contract", tp.template_contract)); GNUNET_free (tp.template_description); - GNUNET_free (tp.image); + GNUNET_free (tp.pos_key); return ret; } 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 b1116f62..57c6dd95 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,8 @@ TMH_private_patch_templates_ID (const struct TMH_RequestHandler *rh, GNUNET_JSON_spec_string ("template_description", (const char **) &tp.template_description), GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_string ("image", - (const char **) &tp.image), + GNUNET_JSON_spec_string ("pos_key", + (const char **) &tp.pos_key), NULL), GNUNET_JSON_spec_json ("template_contract", &tp.template_contract), @@ -145,16 +145,6 @@ TMH_private_patch_templates_ID (const struct TMH_RequestHandler *rh, "template_contract"); } - if ((NULL != tp.image) && (! TMH_image_data_url_valid (tp.image))) - { - GNUNET_break_op (0); - GNUNET_JSON_parse_free (spec); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "image"); - } - qs = TMH_db->update_template (TMH_db->cls, mi->settings.id, template_id, diff --git a/src/backend/taler-merchant-httpd_private-post-templates.c b/src/backend/taler-merchant-httpd_private-post-templates.c index 9cc33eaa..91f8c182 100644 --- a/src/backend/taler-merchant-httpd_private-post-templates.c +++ b/src/backend/taler-merchant-httpd_private-post-templates.c @@ -47,10 +47,8 @@ templates_equal (const struct TALER_MERCHANTDB_TemplateDetails *t1, { return ( (0 == strcmp (t1->template_description, t2->template_description)) && - ( ( (NULL == t1->image) && (NULL == t2->image) ) || - ( (NULL != t1->image) && (NULL != t2->image) && - (0 == strcmp (t1->image, - t2->image)) ) ) && + (0 == strcmp (t1->pos_key, + t2->pos_key) ) && (1 == json_equal (t1->template_contract, t2->template_contract)) ); } @@ -72,7 +70,7 @@ TMH_private_post_templates (const struct TMH_RequestHandler *rh, (const char **) &tp.template_description), GNUNET_JSON_spec_mark_optional( GNUNET_JSON_spec_string ("image", - (const char **) &tp.image), + (const char **) &tp.pos_key), NULL), GNUNET_JSON_spec_json ("template_contract", &tp.template_contract), @@ -107,17 +105,6 @@ TMH_private_post_templates (const struct TMH_RequestHandler *rh, "template_contract"); } - if ( (NULL != tp.image) && - (! TMH_image_data_url_valid (tp.image)) ) - { - GNUNET_break_op (0); - GNUNET_JSON_parse_free (spec); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "image"); - } - /* finally, interact with DB until no serialization error */ for (unsigned int i = 0; i<MAX_RETRIES; i++) { |