File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
src/main/kotlin/infrastructure/api/handlers Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 88
99package infrastructure.api.handlers
1010
11- import application.presenter.api.report.toSurgeryReportInfoDto
11+ import application.presenter.serialization.SurgeryReportSerializer.toApiDto
1212import application.service.SurgeryReportService.SurgeryReportInfoService
1313import infrastructure.provider.Provider
1414import io.netty.handler.codec.http.HttpResponseStatus
1515import io.vertx.core.Handler
1616import io.vertx.ext.web.RoutingContext
17- import kotlinx.serialization.encodeToString
1817import kotlinx.serialization.json.Json
18+ import kotlinx.serialization.json.encodeToJsonElement
1919
2020/* *
2121 * The handler for the authentication API.
@@ -28,16 +28,12 @@ class SurgeryReportInfoHandler(
2828 SurgeryReportInfoService (
2929 routingContext.pathParam(" processId" ),
3030 provider.webClient,
31- ).execute().onComplete {
31+ ).execute().onSuccess { report ->
3232 routingContext
3333 .response()
3434 .setStatusCode(HttpResponseStatus .OK .code())
3535 .end(
36- Json .encodeToString(
37- it.map { sr ->
38- sr.toSurgeryReportInfoDto()
39- }.result(),
40- ),
36+ Json .encodeToJsonElement(report.toApiDto()).toString(),
4137 )
4238 }
4339 }
You can’t perform that action at this time.
0 commit comments