From a01c657512bf7808a4afacb93e9c7b49f3f4edab Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Tue, 2 Apr 2024 15:57:56 +0700 Subject: [PATCH] isSpecial --- src/controllers/OrganizationUnauthorizeController.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index a0521db2..241c4420 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -197,7 +197,10 @@ export class OrganizationUnauthorizeController extends Controller { datePeriodStart.getMonth() - 6, ), ); + const specialPosition = item.positions.find(position => position.positionIsSelected === true); + const isSpecial = specialPosition ? specialPosition.isSpecial : null; return { + id: item.id, prefix: item.current_holder.prefix, firstName: item.current_holder.firstName, lastName: item.current_holder.lastName, @@ -245,7 +248,7 @@ export class OrganizationUnauthorizeController extends Controller { calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year ? false : true, - isSpecial: false, + isSpecial: isSpecial }; }); return new HttpSuccess({ data: formattedData, total: total }); @@ -399,6 +402,7 @@ export class OrganizationUnauthorizeController extends Controller { datePeriodStart.getMonth() - 6, ), ); + return { salaryLevel: item.current_holder.salaryLevel, group: item.current_holder.group, @@ -450,7 +454,6 @@ export class OrganizationUnauthorizeController extends Controller { calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year ? false : true, - isSpecial: false, }; }); return new HttpSuccess({ data: formattedData, total: total });