diff --git a/src/main/kotlin/net/halfbinary/scavengerhuntapi/controller/HunterController.kt b/src/main/kotlin/net/halfbinary/scavengerhuntapi/controller/HunterController.kt index 4861e9c..c82e59d 100644 --- a/src/main/kotlin/net/halfbinary/scavengerhuntapi/controller/HunterController.kt +++ b/src/main/kotlin/net/halfbinary/scavengerhuntapi/controller/HunterController.kt @@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RestController @RestController @@ -27,13 +26,13 @@ class HunterController(private val hunterService: HunterService, @GetMapping("/hunt/ongoing") @Operation(summary = "Gets list of all currently running Hunts (filtered by the calling hunter)") - fun getOngoingHunts(authentication: Authentication, @RequestParam status: HuntStatus?): ResponseEntity> { + fun getOngoingHunts(authentication: Authentication): ResponseEntity> { val email = authentication.name val isAdmin = hunterService.getHunterByEmail(email).isAdmin return if(isAdmin) { ResponseEntity.ok(huntService.getAllHunts(HuntStatus.ONGOING).map { it.toResponse() }) } else { - ResponseEntity.ok(huntService.getHuntsByEmail(email, status).map { it.toResponse() }) + ResponseEntity.ok(huntService.getHuntsByEmail(email, HuntStatus.ONGOING).map { it.toResponse() }) } }