Fix(server) fix cannot change user password from mobile app due to first and last name property don't get passed from the app
This commit is contained in:
parent
9c01ca1080
commit
f2cc7c2873
1 changed files with 8 additions and 1 deletions
|
@ -103,7 +103,14 @@ export class UserService {
|
|||
throw new NotFoundException('User not found');
|
||||
}
|
||||
try {
|
||||
const updatedUser = await this.userRepository.update(user.id, updateUserDto);
|
||||
user.password = updateUserDto.password ?? user.password;
|
||||
user.firstName = updateUserDto.firstName ?? user.firstName;
|
||||
user.lastName = updateUserDto.lastName ?? user.lastName;
|
||||
user.isAdmin = updateUserDto.isAdmin ?? user.isAdmin;
|
||||
user.shouldChangePassword = updateUserDto.shouldChangePassword ?? user.shouldChangePassword;
|
||||
user.profileImagePath = updateUserDto.profileImagePath ?? user.profileImagePath;
|
||||
|
||||
const updatedUser = await this.userRepository.update(user.id, user);
|
||||
|
||||
return mapUser(updatedUser);
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in a new issue