libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit dcc9d141fa47be6aceeffb23b95a4a0ae3914c01
parent d53b2727dc06a05b3b8327373637728c815db379
Author: MS <ms@taler.net>
Date:   Fri,  6 Jan 2023 17:24:48 +0100

Fix response status code.

Responding 204 when the array of incoming
transactions from the Taler Wire Gateway API
is empty.

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt @@ -468,7 +468,14 @@ private suspend fun historyIncoming(call: ApplicationCall) { } } } - return call.respond(TextContent(customConverter(history), ContentType.Application.Json)) + val responseCode = if (history.incoming_transactions.size == 0) + HttpStatusCode.NoContent else + HttpStatusCode.OK + return call.respond( + status = responseCode, + TextContent(customConverter(history), + ContentType.Application.Json) + ) } /**