updated tonitch's reviews
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s

This commit is contained in:
2024-03-13 15:28:17 +01:00
parent 044648674c
commit 4b1db883e2
2 changed files with 18 additions and 11 deletions

View File

@ -38,7 +38,6 @@ public class UserService {
*/
public boolean modifyData(User poster, Map<String ,Object> updates, User target){
System.out.printf("%s and %s",poster.getRegNo(),target.getRegNo());
if (poster.getRegNo().equals(target.getRegNo())){
for (Map.Entry<String, Object> entry : updates.entrySet()){
@ -67,7 +66,7 @@ public class UserService {
target.setProfilePictureUrl((String) entry.getValue());
break;
case "password":
target.setPassword(encodePassword((String) entry.getValue()));
target.setPassword(passwordEncoder.encode((String) entry.getValue()));
break;
}
}
@ -97,14 +96,11 @@ public class UserService {
}
public void save(User user){
user.setPassword(encodePassword(user.getPassword()));
user.setPassword(passwordEncoder.encode(user.getPassword()));
userRepo.save(user);
}
public Iterable<User> getAll(){
return userRepo.findAll();
}
public String encodePassword(String rawPassword){
return passwordEncoder.encode(rawPassword);
}
}