From 4bd650eff23bb3c4892b75df33597d8368c14cf3 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Thu, 7 Nov 2019 13:33:07 +0100 Subject: Send additional state with TabulatorRemote request --- .../main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl') diff --git a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index 8008d529..fcd4b411 100644 --- a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -566,7 +566,7 @@ actual open class KVServiceManager actual constructor(val serviceClass: */ @Suppress("TooGenericExceptionCaught") protected actual inline fun bindTabulatorRemote( - noinline function: suspend T.(Int?, Int?, List?, List?) -> RemoteData + noinline function: suspend T.(Int?, Int?, List?, List?, String?) -> RemoteData ) { val routeDef = "route${this::class.simpleName}${counter++}" addRoute(HttpMethod.POST, "/kv/$routeDef") { req, ctx -> @@ -574,14 +574,16 @@ actual open class KVServiceManager actual constructor(val serviceClass: initializeService(service, req) val jsonRpcRequest = req.awaitBody() @Suppress("MagicNumber") - if (jsonRpcRequest.params.size == 4) { + if (jsonRpcRequest.params.size == 5) { val param1 = getParameter(jsonRpcRequest.params[0]) val param2 = getParameter(jsonRpcRequest.params[1]) val param3 = getParameter?>(jsonRpcRequest.params[2]) @Suppress("MagicNumber") val param4 = getParameter?>(jsonRpcRequest.params[3]) + @Suppress("MagicNumber") + val param5 = getParameter(jsonRpcRequest.params[4]) try { - val result = function.invoke(service, param1, param2, param3, param4) + val result = function.invoke(service, param1, param2, param3, param4, param5) ServerResponse.ok().json().bodyValueAndAwait( mapper.writeValueAsString( JsonRpcResponse( -- cgit