fix: create user
This commit is contained in:
		| @@ -67,14 +67,20 @@ export class UsersService { | ||||
|  | ||||
|     if (createUserDto.superior) { | ||||
|       let approvalRole = ''; | ||||
|       if(superior.roles.name == 'Sales'){ | ||||
|         approvalRole = 'Supervisor'; | ||||
|       if (superior.superior) { | ||||
|         if(superior.roles.name == 'Sales'){ | ||||
|           approvalRole = 'Supervisor'; | ||||
|         } else { | ||||
|           approvalRole = 'Admin'; | ||||
|         } | ||||
|  | ||||
|         userData.superior = superior; | ||||
|         userData.status_approval = superior.superior.id; | ||||
|         userData.is_active = false; | ||||
|       } else { | ||||
|         approvalRole = 'Admin'; | ||||
|         userData.superior = superior; | ||||
|         userData.is_active = true; | ||||
|       } | ||||
|       userData.superior = superior; | ||||
|       userData.status_approval = superior.superior.id; | ||||
|       userData.is_active = false; | ||||
|     } else { | ||||
|       userData.superior = null; | ||||
|       userData.partner = createUserDto.partner; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user