update dto

This commit is contained in:
mirrerror
2023-10-05 14:08:37 +03:00
parent 5350fc3adf
commit 735b2bc90c
9 changed files with 43 additions and 4 deletions

View File

@@ -22,7 +22,10 @@ public class UserMapper {
}
public User toUser(UserCreationDTO userDTO) {
return userService.getUserById(userDTO.getUuid());
User user = userService.getUserById(userDTO.getUuid());
if(user == null) return new User(userDTO.getUuid(), userDTO.getName(),
userDTO.getSurname(), userDTO.getUsername());
return user;
}
}