fix: resend user

This commit is contained in:
ilham 2022-01-24 18:10:21 +07:00
parent 5a4d4f9567
commit e523620a6e
2 changed files with 6 additions and 3 deletions

View File

@ -298,7 +298,11 @@ export class UsersController {
@Put('resend-user/:id')
async resendUser(@Param('id', ParseUUIDPipe) id: string, @Request() req) {
return {
data: await this.usersService.confirmationUser(id, req.user, 'resend'),
data: await this.usersService.confirmationUser(
id,
req.user.userId,
'resend',
),
statusCode: HttpStatus.OK,
message: 'success',
};

View File

@ -571,12 +571,11 @@ export class UsersService {
const dataUser = await this.usersRepository.findOneOrFail(id);
const supervisorUser = await this.findExist(user);
if (status == 'approved') {
if (supervisorUser.roles.name == 'Admin') {
dataUser.status_approval = 'Done';
dataUser.is_active = true;
}else {
} else {
dataUser.status_approval = supervisorUser.superior.id;
}
} else if (status == 'resend') {