Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user