From 74a98d5e7d860241045d5e6c31f9bc6bdf7006b6 Mon Sep 17 00:00:00 2001 From: Arifudinmyf Date: Mon, 24 Jan 2022 15:42:58 +0700 Subject: [PATCH 1/2] penambahan logic untuk supervisorUser --- src/users/users.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/users/users.service.ts b/src/users/users.service.ts index 4e256ac..fda2885 100644 --- a/src/users/users.service.ts +++ b/src/users/users.service.ts @@ -571,8 +571,14 @@ export class UsersService { const dataUser = await this.usersRepository.findOneOrFail(id); const supervisorUser = await this.findExist(user); + if (status == 'approved') { dataUser.status_approval = supervisorUser.superior.id; + if (supervisorUser.roles.name == 'Admin') { + supervisorUser.superior.id; + }else { + dataUser.status_approval = supervisorUser.superior.id; + } } else if (status == 'resend') { dataUser.is_rejected = false; } else { From 776da2b0e40be2a557571877f44ced860e9d0e67 Mon Sep 17 00:00:00 2001 From: Ilham Dwi Pratama S Date: Mon, 24 Jan 2022 16:07:34 +0700 Subject: [PATCH 2/2] fix confirmation user --- src/users/users.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/users/users.service.ts b/src/users/users.service.ts index fda2885..fcfc03b 100644 --- a/src/users/users.service.ts +++ b/src/users/users.service.ts @@ -573,9 +573,8 @@ export class UsersService { if (status == 'approved') { - dataUser.status_approval = supervisorUser.superior.id; if (supervisorUser.roles.name == 'Admin') { - supervisorUser.superior.id; + dataUser.status_approval = 'Done'; }else { dataUser.status_approval = supervisorUser.superior.id; }