From bcbd7c6208ccfd9863af7c038596f4aabd4afcdb Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 27 Feb 2024 16:19:18 +0700 Subject: [PATCH] no message --- src/controllers/SalaryPeriodController.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index ca47924..aa870f5 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -56,8 +56,14 @@ export class SalaryPeriodController extends Controller { } const data = { - group1id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP1" && x.rootId == id)?.id, - group2id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP2" && x.rootId == id)?.id, + group1id: + salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP1" && x.rootId == id) == null + ? null + : salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP1" && x.rootId == id)?.id, + group2id: + salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP2" && x.rootId == id) == null + ? null + : salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP2" && x.rootId == id)?.id, effectiveDate: salaryPeriod.effectiveDate, period: salaryPeriod.period, };