fix: user approval
This commit is contained in:
		| @@ -159,7 +159,7 @@ export class UsersService { | ||||
|       .select([ | ||||
|         'user.id', | ||||
|         'user.username', | ||||
|         'user.isActive', | ||||
|         'user.is_active', | ||||
|         'user.createdAt', | ||||
|         'roles.id', | ||||
|         'roles.name', | ||||
| @@ -276,7 +276,7 @@ export class UsersService { | ||||
|       .select([ | ||||
|         'user.id', | ||||
|         'user.username', | ||||
|         'user.isActive', | ||||
|         'user.is_active', | ||||
|         'roles.id', | ||||
|         'roles.name', | ||||
|         'user_detail', | ||||
| @@ -302,7 +302,7 @@ export class UsersService { | ||||
|     const baseQuery = this.usersRepository | ||||
|       .createQueryBuilder('user') | ||||
|       .where( | ||||
|         'user.id != :id and user.superior_id = :superior and status_approval = :status and isRejected is false', | ||||
|         'user.id != :id and user.superior_id = :superior and status_approval = :status and is_rejected is false', | ||||
|         { | ||||
|           id: superrior.userId, | ||||
|           superior: superrior.userId, | ||||
| @@ -325,7 +325,7 @@ export class UsersService { | ||||
|       .select([ | ||||
|         'user.id', | ||||
|         'user.username', | ||||
|         'user.isActive', | ||||
|         'user.is_active', | ||||
|         'roles.id', | ||||
|         'roles.name', | ||||
|         'user_detail', | ||||
| @@ -404,7 +404,7 @@ export class UsersService { | ||||
|         .select([ | ||||
|           'users.id', | ||||
|           'users.username', | ||||
|           'users.isActive', | ||||
|           'users.is_active', | ||||
|           'users.createdAt', | ||||
|           'roles.id', | ||||
|           'roles.name', | ||||
| @@ -567,9 +567,9 @@ export class UsersService { | ||||
|       if (status == 'approved') { | ||||
|         dataUser.status_approval = supervisorUser.roles.name; | ||||
|       } else if (status == 'resend') { | ||||
|         dataUser.isRejected = false; | ||||
|         dataUser.is_rejected = false; | ||||
|       } else { | ||||
|         dataUser.isRejected = true; | ||||
|         dataUser.is_rejected = true; | ||||
|       } | ||||
|  | ||||
|       const result = await this.usersRepository.save(dataUser); | ||||
| @@ -594,9 +594,9 @@ export class UsersService { | ||||
|     const userData = new User(); | ||||
|  | ||||
|     if (type === 'active') { | ||||
|       userData.isActive = true; | ||||
|       userData.is_active = true; | ||||
|     } else { | ||||
|       userData.isActive = false; | ||||
|       userData.is_active = false; | ||||
|     } | ||||
|  | ||||
|     await this.connection.transaction(async (manager) => { | ||||
| @@ -630,7 +630,7 @@ export class UsersService { | ||||
|     return this.usersRepository.findOneOrFail({ | ||||
|       where: { | ||||
|         username, | ||||
|         isActive: true, | ||||
|         is_active: true, | ||||
|       }, | ||||
|       relations: ['roles', 'partner'], | ||||
|     }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user