Merge branch 'master' into Max/Backend/ReturnUserPasswordIssue
This commit is contained in:
@ -83,7 +83,6 @@ public class UserController {
|
||||
|
||||
@GetMapping("/teachers")
|
||||
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllTeachers(@RequestHeader("Authorization") String token){
|
||||
|
||||
if (authServ.getUserFromToken(token) == null)
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
@ -91,5 +90,15 @@ public class UserController {
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(teachers), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/students")
|
||||
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllStudent(@RequestHeader("Authorization") String token){
|
||||
if (authServ.getUserFromToken(token) == null)
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Iterable<User> students = userService.getAllStudents();
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(students), HttpStatus.OK);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user