From 81e1ef6b39eee646d74f8aed9c5f3ed738eb1af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Thu, 21 May 2020 22:30:19 +0200 Subject: [PATCH] minor refactor of server --- src/api/route/InputServiceServer.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/route/InputServiceServer.kt b/src/api/route/InputServiceServer.kt index 6a64da1..63dc090 100644 --- a/src/api/route/InputServiceServer.kt +++ b/src/api/route/InputServiceServer.kt @@ -97,8 +97,10 @@ class InputServiceServer { val tag = UUID.randomUUID().toString() + val currentApiObject = ApiObject(tag = tag, date = description!!.date, device_id = description!!.device_id) + transaction { - resultObjectService.addOne(ApiObject(tag = tag, date = description!!.date, device_id = description!!.device_id)) + resultObjectService.addOne(currentApiObject) } connection.confirmChannel { @@ -107,7 +109,7 @@ class InputServiceServer { } } - call.respond(resultObjectService.getAllInputObjects()) + call.respond(currentApiObject) } get("/sample/{tagID}") {