Adds get ongoing Hunts endpoint

This commit is contained in:
2026-05-18 23:01:59 -05:00
parent 74391f8a46
commit 5e2976180c

View File

@@ -46,6 +46,12 @@ class HuntController(private val huntService: HuntService) {
return ResponseEntity.ok(huntService.getAllHunts(HuntStatus.UNSTARTED).map { it.toResponse() }) return ResponseEntity.ok(huntService.getAllHunts(HuntStatus.UNSTARTED).map { it.toResponse() })
} }
@GetMapping("/ongoing")
@Operation(summary = "Gets list of all ongoing Hunts")
fun getOngoingHunts(): ResponseEntity<List<HuntResponse>> {
return ResponseEntity.ok(huntService.getAllHunts(HuntStatus.ONGOING).map { it.toResponse() })
}
@PreAuthorize("hasRole('ADMIN')") @PreAuthorize("hasRole('ADMIN')")
@Tag(name = "Admin") @Tag(name = "Admin")
@PostMapping @PostMapping