mirror of
https://github.com/revanced/revanced-api.git
synced 2025-05-02 15:44:33 +02:00
fix: Add missing OK response to routes
This commit is contained in:
parent
53c36002e9
commit
1181be12e2
@ -94,6 +94,8 @@ internal fun Route.announcementsRoute() = route("announcements") {
|
|||||||
|
|
||||||
post<APIAnnouncement> { announcement ->
|
post<APIAnnouncement> { announcement ->
|
||||||
announcementService.new(announcement)
|
announcementService.new(announcement)
|
||||||
|
|
||||||
|
call.respond(HttpStatusCode.OK)
|
||||||
}
|
}
|
||||||
|
|
||||||
route("{id}") {
|
route("{id}") {
|
||||||
@ -103,12 +105,16 @@ internal fun Route.announcementsRoute() = route("announcements") {
|
|||||||
val id: Int by call.parameters
|
val id: Int by call.parameters
|
||||||
|
|
||||||
announcementService.update(id, announcement)
|
announcementService.update(id, announcement)
|
||||||
|
|
||||||
|
call.respond(HttpStatusCode.OK)
|
||||||
}
|
}
|
||||||
|
|
||||||
delete {
|
delete {
|
||||||
val id: Int by call.parameters
|
val id: Int by call.parameters
|
||||||
|
|
||||||
announcementService.delete(id)
|
announcementService.delete(id)
|
||||||
|
|
||||||
|
call.respond(HttpStatusCode.OK)
|
||||||
}
|
}
|
||||||
|
|
||||||
route("archive") {
|
route("archive") {
|
||||||
@ -119,6 +125,8 @@ internal fun Route.announcementsRoute() = route("announcements") {
|
|||||||
val archivedAt = call.receiveNullable<APIAnnouncementArchivedAt>()?.archivedAt
|
val archivedAt = call.receiveNullable<APIAnnouncementArchivedAt>()?.archivedAt
|
||||||
|
|
||||||
announcementService.archive(id, archivedAt)
|
announcementService.archive(id, archivedAt)
|
||||||
|
|
||||||
|
call.respond(HttpStatusCode.OK)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,6 +137,8 @@ internal fun Route.announcementsRoute() = route("announcements") {
|
|||||||
val id: Int by call.parameters
|
val id: Int by call.parameters
|
||||||
|
|
||||||
announcementService.unarchive(id)
|
announcementService.unarchive(id)
|
||||||
|
|
||||||
|
call.respond(HttpStatusCode.OK)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user