diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-patch-orders-ID-forget.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-patch-orders-ID-forget.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/backend/taler-merchant-httpd_private-patch-orders-ID-forget.c b/src/backend/taler-merchant-httpd_private-patch-orders-ID-forget.c index 798d610a..78d2189a 100644 --- a/src/backend/taler-merchant-httpd_private-patch-orders-ID-forget.c +++ b/src/backend/taler-merchant-httpd_private-patch-orders-ID-forget.c @@ -93,7 +93,7 @@ TMH_private_patch_orders_ID_forget (const struct TMH_RequestHandler *rh, for (unsigned int i = 0; i<MAX_RETRIES; i++) { - json_t *fields; + const json_t *fields; json_t *contract_terms; bool changed = false; bool paid = false; @@ -138,8 +138,8 @@ TMH_private_patch_orders_ID_forget (const struct TMH_RequestHandler *rh, { struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_json ("fields", - &fields), + GNUNET_JSON_spec_array_const ("fields", + &fields), GNUNET_JSON_spec_end () }; enum GNUNET_GenericReturnValue res; @@ -156,17 +156,6 @@ TMH_private_patch_orders_ID_forget (const struct TMH_RequestHandler *rh, : MHD_NO; } } - if (! (json_is_array (fields))) - { - TMH_db->rollback (TMH_db->cls); - json_decref (contract_terms); - json_decref (fields); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "fields"); - } - { size_t index; json_t *value; @@ -179,7 +168,6 @@ TMH_private_patch_orders_ID_forget (const struct TMH_RequestHandler *rh, { TMH_db->rollback (TMH_db->cls); json_decref (contract_terms); - json_decref (fields); return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, TALER_EC_MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT, @@ -194,7 +182,6 @@ TMH_private_patch_orders_ID_forget (const struct TMH_RequestHandler *rh, /* We tried to forget a field that isn't forgettable */ TMH_db->rollback (TMH_db->cls); json_decref (contract_terms); - json_decref (fields); return TALER_MHD_reply_with_error (connection, MHD_HTTP_CONFLICT, TALER_EC_MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_NOT_FORGETTABLE, @@ -207,7 +194,6 @@ TMH_private_patch_orders_ID_forget (const struct TMH_RequestHandler *rh, /* One of the paths was malformed and couldn't be expanded */ TMH_db->rollback (TMH_db->cls); json_decref (contract_terms); - json_decref (fields); return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, TALER_EC_MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT, @@ -220,7 +206,6 @@ TMH_private_patch_orders_ID_forget (const struct TMH_RequestHandler *rh, { TMH_db->rollback (TMH_db->cls); json_decref (contract_terms); - json_decref (fields); return TALER_MHD_reply_static (connection, MHD_HTTP_NO_CONTENT, NULL, @@ -232,7 +217,6 @@ TMH_private_patch_orders_ID_forget (const struct TMH_RequestHandler *rh, order_id, contract_terms); json_decref (contract_terms); - json_decref (fields); if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs) { TMH_db->rollback (TMH_db->cls); |