Merge branch 'development' into 'devops-staging'
fix: change password partner See merge request empatnusabangsa/ppob/ppob-backend!86
This commit is contained in:
		| @@ -261,10 +261,13 @@ export class UsersController { | |||||||
|   async updatePasswordPartner( |   async updatePasswordPartner( | ||||||
|     @Param('id', ParseUUIDPipe) id: string, |     @Param('id', ParseUUIDPipe) id: string, | ||||||
|     @Request() req, |     @Request() req, | ||||||
|     @Body() updateUserDto: UpdateUserDto, |     @Body() request, | ||||||
|   ) { |   ) { | ||||||
|     return { |     return { | ||||||
|       data: await this.usersService.updatePasswordPartner(id, updateUserDto), |       data: await this.usersService.updatePasswordPartner( | ||||||
|  |         id, | ||||||
|  |         request.password_account, | ||||||
|  |       ), | ||||||
|       statusCode: HttpStatus.OK, |       statusCode: HttpStatus.OK, | ||||||
|       message: 'success', |       message: 'success', | ||||||
|     }; |     }; | ||||||
|   | |||||||
| @@ -466,7 +466,7 @@ export class UsersService { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   async updatePasswordPartner(id: string, updateUserDto: UpdateUserDto) { |   async updatePasswordPartner(id: string, password) { | ||||||
|     try { |     try { | ||||||
|       const dataUser = await this.usersRepository.findOneOrFail({ |       const dataUser = await this.usersRepository.findOneOrFail({ | ||||||
|         where: { |         where: { | ||||||
| @@ -474,10 +474,7 @@ export class UsersService { | |||||||
|         }, |         }, | ||||||
|       }); |       }); | ||||||
|  |  | ||||||
|       dataUser.password = await hashPassword( |       dataUser.password = await hashPassword(password, dataUser.salt); | ||||||
|         updateUserDto.password, |  | ||||||
|         dataUser.salt, |  | ||||||
|       ); |  | ||||||
|  |  | ||||||
|       const result = await this.usersRepository.save(dataUser); |       const result = await this.usersRepository.save(dataUser); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user