Skip to content

Commit

Permalink
release: 0.5.5 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb authored May 17, 2024
2 parents d217529 + 3c49ed1 commit 69f8f7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class PersonaController(
}

@ExceptionHandler(IllegalArgumentException::class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
fun handleIllegalArgumentException(exception: IllegalArgumentException): ErrorResponse =
ErrorResponse.from(exception)
}
3 changes: 2 additions & 1 deletion src/main/kotlin/org/gitanimals/render/domain/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ class User(
val persona = personas.find { it.id == personaId }
?: throw IllegalArgumentException("Cannot find persona by id \"$personaId\"")

persona.visible = visible

val visiblePersonas = personas.filter { it.visible }

require(visiblePersonas.size < MAX_PERSONA_COUNT) {
"Persona count must be under \"$MAX_PERSONA_COUNT\" but, current persona count is \"${visiblePersonas.size}\""
}

persona.visible = visible
return persona
}

Expand Down

0 comments on commit 69f8f7b

Please sign in to comment.