diff --git a/src/main/kotlin/net/halfbinary/scavengerhuntapi/controller/HuntController.kt b/src/main/kotlin/net/halfbinary/scavengerhuntapi/controller/HuntController.kt index 4fc6ae7..7314ecd 100644 --- a/src/main/kotlin/net/halfbinary/scavengerhuntapi/controller/HuntController.kt +++ b/src/main/kotlin/net/halfbinary/scavengerhuntapi/controller/HuntController.kt @@ -2,6 +2,7 @@ package net.halfbinary.scavengerhuntapi.controller import jakarta.validation.Valid import net.halfbinary.scavengerhuntapi.model.HuntId +import net.halfbinary.scavengerhuntapi.model.HunterId import net.halfbinary.scavengerhuntapi.model.converter.toDomain import net.halfbinary.scavengerhuntapi.model.converter.toResponse import net.halfbinary.scavengerhuntapi.model.request.HuntCreateRequest @@ -30,4 +31,9 @@ class HuntController(private val huntService: HuntService) { return ResponseEntity.ok(huntService.createHunt(huntRequest.toDomain()).toResponse()) } + @GetMapping("/hunter/{hunterId}") + fun getHuntsByHunter(@PathVariable("hunterId") hunterId: HunterId): ResponseEntity> { + return ResponseEntity.ok(huntService.getHuntsByHunter(hunterId).map { it.toResponse() }) + } + } \ No newline at end of file