isSpecial

This commit is contained in:
AdisakKanthawilang 2024-04-02 15:57:56 +07:00
parent 9d77bc44c4
commit a01c657512

View file

@ -197,7 +197,10 @@ export class OrganizationUnauthorizeController extends Controller {
datePeriodStart.getMonth() - 6, datePeriodStart.getMonth() - 6,
), ),
); );
const specialPosition = item.positions.find(position => position.positionIsSelected === true);
const isSpecial = specialPosition ? specialPosition.isSpecial : null;
return { return {
id: item.id,
prefix: item.current_holder.prefix, prefix: item.current_holder.prefix,
firstName: item.current_holder.firstName, firstName: item.current_holder.firstName,
lastName: item.current_holder.lastName, lastName: item.current_holder.lastName,
@ -245,7 +248,7 @@ export class OrganizationUnauthorizeController extends Controller {
calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year
? false ? false
: true, : true,
isSpecial: false, isSpecial: isSpecial
}; };
}); });
return new HttpSuccess({ data: formattedData, total: total }); return new HttpSuccess({ data: formattedData, total: total });
@ -399,6 +402,7 @@ export class OrganizationUnauthorizeController extends Controller {
datePeriodStart.getMonth() - 6, datePeriodStart.getMonth() - 6,
), ),
); );
return { return {
salaryLevel: item.current_holder.salaryLevel, salaryLevel: item.current_holder.salaryLevel,
group: item.current_holder.group, group: item.current_holder.group,
@ -450,7 +454,6 @@ export class OrganizationUnauthorizeController extends Controller {
calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year
? false ? false
: true, : true,
isSpecial: false,
}; };
}); });
return new HttpSuccess({ data: formattedData, total: total }); return new HttpSuccess({ data: formattedData, total: total });