New endpints tests
This commit is contained in:
@ -158,6 +158,11 @@ public class CommisionController extends TokenBasedController {
|
||||
public ResponseEntity<List<AssignmentResponse>> getCurrentAssignmentsDeanery(
|
||||
@PathVariable(name = "id") Long userId) throws Exception {
|
||||
User user = this.userService.getById(userId).orElseThrow(() -> new NullPointerException());
|
||||
|
||||
if (user.getRole() == UserRoles.DEANERY) {
|
||||
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
Optional<Commision> com = this.commisionService.getNewestCommision(user);
|
||||
|
||||
if (com.isPresent()) {
|
||||
|
Reference in New Issue
Block a user