libeufin

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

commit 54e9a6254dd34acb3fdf3eceaacf71f92318787f
parent d4392440cc7f5321b78905dd2d57c219ce3f6910
Author: ms <ms@taler.net>
Date:   Tue, 21 Dec 2021 08:28:26 +0100

move demobank check at a earlier step

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 10+++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -954,6 +954,8 @@ val sandboxApp: Application.() -> Unit = { } get("/demobanks/{demobankid}") { + val demobank = ensureDemobank(call) + /** * Respond the SPA if the content type is not "application/json". */ @@ -975,13 +977,7 @@ val sandboxApp: Application.() -> Unit = { return@get } expectAdmin(call.request.basicAuth()) - val demobankId = call.getUriComponent("demobankid") - val ret: DemobankConfigEntity = transaction { - DemobankConfigEntity.find { - DemobankConfigsTable.name eq demobankId - }.firstOrNull() - } ?: throw notFound("Demobank ${demobankId} not found") - call.respond(getJsonFromDemobankConfig(ret)) + call.respond(getJsonFromDemobankConfig(demobank)) return@get }