Adds login ability, error handling, and logging (#1)
Reviewed-on: #1 Co-authored-by: aarbit <aarbit@gmail.com> Co-committed-by: aarbit <aarbit@gmail.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -12,12 +12,7 @@ import org.springframework.web.bind.annotation.RestController
|
||||
class SignupController(private val signupService: SignupService) {
|
||||
@PostMapping("/signup")
|
||||
fun hunterSignup(@RequestBody body: HunterSignupRequest): ResponseEntity<Any> {
|
||||
try {
|
||||
signupService.createNewHunter(body.toDomain())
|
||||
return ResponseEntity.ok().build()
|
||||
} catch (e: RuntimeException) {
|
||||
return ResponseEntity.badRequest().body(e.message)
|
||||
}
|
||||
|
||||
signupService.createNewHunter(body.toDomain())
|
||||
return ResponseEntity.ok().build()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user