mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-01-10 21:36:18 +00:00
fix: Add missing OK response to routes
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user