user nules

This commit is contained in:
Filip Izydorczyk
2020-12-18 15:24:01 +01:00
parent ca440a3fd5
commit 5ef7c19ade
5 changed files with 30 additions and 22 deletions

View File

@ -120,6 +120,11 @@ public class App {
newuser.setSurname("Sad");
newuser.setRole(UserRoles.STUDENT);
this.userService.save(newuser);
newuser = new User();
newuser.setEmail("iamnull@st.amu.edu.pl");
newuser.setRole(UserRoles.STUDENT);
this.userService.save(newuser);
}
System.out.println(Logo.getStartedInfo(isDev));

View File

@ -47,7 +47,7 @@ public class UsersController {
@PreAuthorize("hasRole('ROLE_DEANERY')")
@ApiOperation(value = "Gets all students. You need token with DEANERY role to call this")
public ResponseEntity<List<UserResponse>> getAllStudents() {
final List<User> searches = this.userService.searchForStudents("");
final List<User> searches = this.userService.getAllStudents();
final List<UserResponse> response = UserResponseMappers.mapToDefaultResponse(searches);
return new ResponseEntity<>(response, HttpStatus.OK);
}