aboutsummaryrefslogtreecommitdiff
path: root/src/auditor/taler-auditor-httpd_coin-inconsistency-get.c
diff options
context:
space:
mode:
authorCedric Zwahlen <cedric.zwahlen@students.bfh.ch>2024-04-11 18:34:24 +0200
committerCedric Zwahlen <cedric.zwahlen@students.bfh.ch>2024-04-19 20:47:33 +0200
commit962bcbc6a6bd10f3bbe80766278c36b02f53c7e4 (patch)
tree39634fd97747bc2c2330c75fd93b91c8dc4dbab5 /src/auditor/taler-auditor-httpd_coin-inconsistency-get.c
parent99edbc9a947d494907d57ef64d124081fc475ff0 (diff)
downloadexchange-962bcbc6a6bd10f3bbe80766278c36b02f53c7e4.tar.gz
exchange-962bcbc6a6bd10f3bbe80766278c36b02f53c7e4.tar.bz2
exchange-962bcbc6a6bd10f3bbe80766278c36b02f53c7e4.zip
Add remaining CRUD
Diffstat (limited to 'src/auditor/taler-auditor-httpd_coin-inconsistency-get.c')
-rw-r--r--src/auditor/taler-auditor-httpd_coin-inconsistency-get.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/auditor/taler-auditor-httpd_coin-inconsistency-get.c b/src/auditor/taler-auditor-httpd_coin-inconsistency-get.c
index ca08f7d4c..84f7a6f60 100644
--- a/src/auditor/taler-auditor-httpd_coin-inconsistency-get.c
+++ b/src/auditor/taler-auditor-httpd_coin-inconsistency-get.c
@@ -31,8 +31,6 @@ add_coin_inconsistency (void *cls,
json_t *list = cls;
json_t *obj;
- printf ("checkpoint pg_3\n");
-
obj = GNUNET_JSON_PACK (
GNUNET_JSON_pack_data_auto ("operation", &dc->operation),
TALER_JSON_pack_amount ("exchange_amount", &dc->exchange_amount),
@@ -45,7 +43,7 @@ add_coin_inconsistency (void *cls,
json_array_append_new (list,
obj));
- printf ("checkpoint pg_4\n");
+
return GNUNET_OK;
}
@@ -87,19 +85,28 @@ TAH_COIN_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh,
}
ja = json_array ();
GNUNET_break (NULL != ja);
+ int64_t limit = -20;
+ uint64_t offset;
+
+ TALER_MHD_parse_request_snumber (connection,
+ "limit",
+ &limit);
- uint64_t row_id = 0;
- bool return_suppressed;
+ if (limit < 0)
+ offset = INT64_MAX;
+ else
+ offset = 0;
- struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_uint64 ("row_id",
- &row_id),
+ TALER_MHD_parse_request_number (connection,
+ "offset",
+ &offset);
- GNUNET_JSON_spec_bool ("return_suppressed",
- &return_suppressed),
+ bool return_suppressed = false;
- GNUNET_JSON_spec_end ()
- };
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed),
+ GNUNET_JSON_spec_end ()
+ };
// read the input json
@@ -132,11 +139,11 @@ TAH_COIN_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh,
}
}
- printf ("checkpoint httpd\n");
qs = TAH_plugin->get_coin_inconsistency (
TAH_plugin->cls,
- row_id,
+ limit,
+ offset,
return_suppressed,
&add_coin_inconsistency,
ja);