Merge remote-tracking branch 'origin/main'

This commit is contained in:
2025-12-17 20:45:08 +01:00
2 changed files with 5 additions and 5 deletions
@@ -30,7 +30,7 @@ public class UserController {
@ApiResponse(responseCode = "404", description = "Nutzerprofil nicht gefunden",
content = @Content(mediaType = "application/json"))
})
@GetMapping("/profile{id}")
@GetMapping("/profile/{id}")
public ResponseEntity<MinimalUserDTO> getUser(@PathVariable long id) {
return new ResponseEntity<>(this.userService.getUser(id), HttpStatus.OK);
}
@@ -42,15 +42,15 @@ public class UserService {
// throw new RuntimeException("Kein Zugriff auf dieses Profil");
// }
if (status == null) {
return new MinimalUserDTO(requested.getId(), requested.getPublicName());
}
switch (status) {
case ACCEPTED -> {
return new MinimalUserDTO(requested.getId(), requested.getPrivateName());
}
case BLOCKED -> {
throw new RuntimeException("Kein Zugriff auf dieses Profil");
}
default -> {
return new MinimalUserDTO(requested.getId(), requested.getPublicName());
}