From 74a98d5e7d860241045d5e6c31f9bc6bdf7006b6 Mon Sep 17 00:00:00 2001 From: Arifudinmyf Date: Mon, 24 Jan 2022 15:42:58 +0700 Subject: [PATCH] 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 {