feat: added most of shared API calls
This commit is contained in:
@ -26,15 +26,14 @@ public class UserService {
|
||||
}
|
||||
|
||||
// TODO
|
||||
public long getIdUserByEmail(String email) {
|
||||
public User getUserByEmail(String email) {
|
||||
Optional<User> opt_user = this.userRepository.findByPrimaryMail(email);
|
||||
|
||||
if (opt_user.isEmpty()) {
|
||||
System.err.println("Couldn't find user with email " + email);
|
||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
User user = opt_user.get();
|
||||
return user.getIdUser();
|
||||
return opt_user.get();
|
||||
}
|
||||
|
||||
public Iterable<User> allUsers() {
|
||||
|
Reference in New Issue
Block a user