feat(server): add fixup endpoint and move update endpoint

This commit is contained in:
Cilly Leang 2026-04-12 00:31:41 +10:00
parent 38bcdc54bc
commit 27f2a08d77
Signed by: cilly
GPG key ID: 6500251E087653C9

View file

@ -56,7 +56,19 @@ fun Application.module() {
get<GtfsDataFixer>().addParentsToStops() get<GtfsDataFixer>().addParentsToStops()
} }
} }
get("/update") { get("/manage/fixup") {
val key = call.parameters["key"]
if (key != Constants.updateKey) {
call.respond(HttpStatusCode.Forbidden)
return@get
}
call.respondText("fixing")
launch(context = Dispatchers.IO) {
get<GtfsDataFixer>().addParentsToStops()
}
}
get("/manage/update") {
val key = call.parameters["key"] val key = call.parameters["key"]
if (key != Constants.updateKey) { if (key != Constants.updateKey) {
call.respond(HttpStatusCode.Forbidden) call.respond(HttpStatusCode.Forbidden)