diff options
author | MS <ms@taler.net> | 2023-01-06 17:24:48 +0100 |
---|---|---|
committer | MS <ms@taler.net> | 2023-01-06 17:24:48 +0100 |
commit | dcc9d141fa47be6aceeffb23b95a4a0ae3914c01 (patch) | |
tree | 485577344426ddc2a518f8b65e87c15dea791821 /nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt | |
parent | d53b2727dc06a05b3b8327373637728c815db379 (diff) | |
download | libeufin-dcc9d141fa47be6aceeffb23b95a4a0ae3914c01.tar.gz libeufin-dcc9d141fa47be6aceeffb23b95a4a0ae3914c01.tar.bz2 libeufin-dcc9d141fa47be6aceeffb23b95a4a0ae3914c01.zip |
Fix response status code.
Responding 204 when the array of incoming
transactions from the Taler Wire Gateway API
is empty.
Diffstat (limited to 'nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt')
-rw-r--r-- | nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt index 264d092e..2929eca5 100644 --- 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) + ) } /** |