fix: change password partner
This commit is contained in:
parent
68cd326ca4
commit
7162bc34dd
|
@ -261,10 +261,13 @@ export class UsersController {
|
|||
async updatePasswordPartner(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Request() req,
|
||||
@Body() updateUserDto: UpdateUserDto,
|
||||
@Body() request,
|
||||
) {
|
||||
return {
|
||||
data: await this.usersService.updatePasswordPartner(id, updateUserDto),
|
||||
data: await this.usersService.updatePasswordPartner(
|
||||
id,
|
||||
request.password_account,
|
||||
),
|
||||
statusCode: HttpStatus.OK,
|
||||
message: 'success',
|
||||
};
|
||||
|
|
|
@ -466,7 +466,7 @@ export class UsersService {
|
|||
}
|
||||
}
|
||||
|
||||
async updatePasswordPartner(id: string, updateUserDto: UpdateUserDto) {
|
||||
async updatePasswordPartner(id: string, password) {
|
||||
try {
|
||||
const dataUser = await this.usersRepository.findOneOrFail({
|
||||
where: {
|
||||
|
@ -474,10 +474,7 @@ export class UsersService {
|
|||
},
|
||||
});
|
||||
|
||||
dataUser.password = await hashPassword(
|
||||
updateUserDto.password,
|
||||
dataUser.salt,
|
||||
);
|
||||
dataUser.password = await hashPassword(password, dataUser.salt);
|
||||
|
||||
const result = await this.usersRepository.save(dataUser);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user