diff --git a/backend/src/main/java/com/paligot/confily/backend/third/parties/openplanner/OpenPlannerRouting.kt b/backend/src/main/java/com/paligot/confily/backend/third/parties/openplanner/OpenPlannerRouting.kt index 7e689974..06261084 100644 --- a/backend/src/main/java/com/paligot/confily/backend/third/parties/openplanner/OpenPlannerRouting.kt +++ b/backend/src/main/java/com/paligot/confily/backend/third/parties/openplanner/OpenPlannerRouting.kt @@ -1,6 +1,7 @@ package com.paligot.confily.backend.third.parties.openplanner import com.paligot.confily.backend.NotAuthorized +import com.paligot.confily.backend.events.EventModule.eventRepositoryV4 import com.paligot.confily.backend.third.parties.openplanner.OpenPlannerModule.openPlannerRepository import io.ktor.http.HttpStatusCode import io.ktor.server.response.respond @@ -9,10 +10,12 @@ import io.ktor.server.routing.post fun Routing.registerOpenPlannerRoutes() { val repository by openPlannerRepository + val eventRepository by eventRepositoryV4 post("openplanner/webhook") { val eventId = call.parameters["eventId"]!! val apiKey = call.request.queryParameters["api_key"] ?: throw NotAuthorized - call.respond(HttpStatusCode.Created, repository.update(eventId, apiKey)) + repository.update(eventId, apiKey) + call.respond(HttpStatusCode.Created, eventRepository.generateAgenda(eventId, apiKey)) } }