From 1b2fbb5cbedcab5c65a964388cdcafb1fb62366a Mon Sep 17 00:00:00 2001 From: GerardPaligot Date: Sat, 7 Dec 2024 22:38:54 +0100 Subject: [PATCH] refactor(backend): generate new agenda version automatically with OP. --- .../backend/third/parties/openplanner/OpenPlannerRouting.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 7e6899745..06261084c 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)) } }