updated tonitch's reviews
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user