commit eb10b91085665da0e2e6395279b46ac9d6d4bfef
parent b151ab0afd0efd159dbed1e6b8b485c59cb4977b
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 2 Jun 2026 21:20:42 +0200
actually enable GET /history endpoint
Diffstat:
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c
@@ -521,6 +521,13 @@ handle_mhd_request (void *cls,
.handler.post = &DH_handler_post_charities,
.needs_authorization = true
},
+ /* GET history */
+ {
+ .url = "history",
+ .method = MHD_HTTP_METHOD_GET,
+ .handler.get = &DH_handler_get_history,
+ .needs_authorization = true
+ },
/* PATCH charities */
{
.url = "charities",
diff --git a/src/donau/donau-httpd_get-history.c b/src/donau/donau-httpd_get-history.c
@@ -29,10 +29,6 @@
#include "donau-httpd_get-history.h"
#include "donau-database/get_history.h"
-/**
- * Maximum number of history we return per request.
- */
-// #define MAX_RECORDS 1024
/**
* Return history information.
@@ -54,7 +50,7 @@ history_cb (
GNUNET_assert (
0 ==
- json_array_append (
+ json_array_append_new (
history,
GNUNET_JSON_PACK (
GNUNET_JSON_pack_int64 ("charity_id",
@@ -103,6 +99,7 @@ DH_handler_get_history (
TALER_EC_GENERIC_DB_FETCH_FAILED,
NULL);
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+ json_decref (history);
return TALER_MHD_reply_static (
rc->connection,
MHD_HTTP_NO_CONTENT,