Skip to content

Commit

Permalink
fix: Add missing OK response to routes
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Sep 29, 2024
1 parent 53c3600 commit 1181be1
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ internal fun Route.announcementsRoute() = route("announcements") {

post<APIAnnouncement> { announcement ->
announcementService.new(announcement)

call.respond(HttpStatusCode.OK)
}

route("{id}") {
Expand All @@ -103,12 +105,16 @@ internal fun Route.announcementsRoute() = route("announcements") {
val id: Int by call.parameters

announcementService.update(id, announcement)

call.respond(HttpStatusCode.OK)
}

delete {
val id: Int by call.parameters

announcementService.delete(id)

call.respond(HttpStatusCode.OK)
}

route("archive") {
Expand All @@ -119,6 +125,8 @@ internal fun Route.announcementsRoute() = route("announcements") {
val archivedAt = call.receiveNullable<APIAnnouncementArchivedAt>()?.archivedAt

announcementService.archive(id, archivedAt)

call.respond(HttpStatusCode.OK)
}
}

Expand All @@ -129,6 +137,8 @@ internal fun Route.announcementsRoute() = route("announcements") {
val id: Int by call.parameters

announcementService.unarchive(id)

call.respond(HttpStatusCode.OK)
}
}
}
Expand Down

0 comments on commit 1181be1

Please sign in to comment.