Compare commits
2 Commits
a57d673c06
...
2ecdbf8d72
Author | SHA1 | Date | |
---|---|---|---|
2ecdbf8d72 | |||
316ca7c042 |
@ -17,9 +17,6 @@ public class UserService {
|
|||||||
if (appUserRepository.existsByUsername(username)) {
|
if (appUserRepository.existsByUsername(username)) {
|
||||||
throw new IllegalArgumentException("Username already exists");
|
throw new IllegalArgumentException("Username already exists");
|
||||||
}
|
}
|
||||||
if (appUserRepository.existsByEmail(email)) {
|
|
||||||
throw new IllegalArgumentException("Email already exists");
|
|
||||||
}
|
|
||||||
|
|
||||||
AppUser newUser = new AppUser(username, email, "USER");
|
AppUser newUser = new AppUser(username, email, "USER");
|
||||||
appUserRepository.save(newUser);
|
appUserRepository.save(newUser);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user