fix approval user
This commit is contained in:
		| @@ -73,7 +73,7 @@ export class UsersService { | ||||
|         approvalRole = 'Admin'; | ||||
|       } | ||||
|       userData.superior = superior; | ||||
|       userData.status_approval = approvalRole; | ||||
|       userData.status_approval = superior.superior.id; | ||||
|     } else { | ||||
|       userData.superior = null; | ||||
|       userData.partner = createUserDto.partner; | ||||
| @@ -311,8 +311,7 @@ export class UsersService { | ||||
|         'user.id != :id and user.superior_id = :superior and status_approval = :status and is_rejected is false', | ||||
|         { | ||||
|           id: superrior.userId, | ||||
|           superior: superrior.userId, | ||||
|           status: dataUser.roles.name, | ||||
|           status: superrior.userId, | ||||
|         }, | ||||
|       ) | ||||
|       .leftJoinAndSelect('user.roles', 'roles', `roles.id = user.roles_id`) | ||||
| @@ -571,7 +570,7 @@ export class UsersService { | ||||
|       const supervisorUser = await this.usersRepository.findOneOrFail(id); | ||||
|  | ||||
|       if (status == 'approved') { | ||||
|         dataUser.status_approval = supervisorUser.roles.name; | ||||
|         dataUser.status_approval = supervisorUser.superior.id; | ||||
|       } else if (status == 'resend') { | ||||
|         dataUser.is_rejected = false; | ||||
|       } else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user