From 7ad713116f87b4899dff5b03f1483cead2d113ad Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Tue, 18 Jun 2024 17:42:47 +0700 Subject: [PATCH] fix --- src/controllers/ProfileController.ts | 20 ++++++++++---------- src/controllers/ProfileEmployeeController.ts | 17 +++++++++-------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 7fd9c577..e8a1ca80 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -3330,16 +3330,16 @@ export class ProfileController extends Controller { await new CallAPI().PostData(request, "org/profile/salary", { profileId: profile.id, date: requestBody.dateLeave, - amount: profileSalary?.amount, - positionSalaryAmount: profileSalary?.positionSalaryAmount, - mouthSalaryAmount: profileSalary?.mouthSalaryAmount, - posNo: profileSalary?.posNo, - position: profileSalary?.position, - positionLine: profileSalary?.positionLine, - positionPathSide: profileSalary?.positionPathSide, - positionExecutive: profileSalary?.positionExecutive, - positionType: profileSalary?.positionType, - positionLevel: profileSalary?.positionLevel, + amount: profileSalary?.amount ?? null, + positionSalaryAmount: profileSalary?.positionSalaryAmount ?? null, + mouthSalaryAmount: profileSalary?.mouthSalaryAmount?? null, + posNo: profileSalary?.posNo ?? null, + position: profileSalary?.position ?? null, + positionLine: profileSalary?.positionLine ?? null, + positionPathSide: profileSalary?.positionPathSide ?? null, + positionExecutive: profileSalary?.positionExecutive ?? null, + positionType: profileSalary?.positionType ?? null, + positionLevel: profileSalary?.positionLevel ?? null, refCommandNo: null, templateDoc: requestBody.leaveReason, }); diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index c6aee17c..71f6d4db 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -59,6 +59,7 @@ import { } from "../entities/ProfileEmployeeEmployment"; import { ProfileEmployeeEmploymentHistory } from "../entities/ProfileEmployeeEmploymentHistory"; import CallAPI from "../interfaces/call-api"; +import e from "cors"; @Route("api/v1/org/profile-employee") @Tags("ProfileEmployee") @@ -2694,17 +2695,17 @@ export class ProfileEmployeeController extends Controller { await new CallAPI().PostData(request, "org/profile-employee/salary", { profileEmployeeId: profile.id, date: requestBody.dateLeave, - amount: profileSalary?.amount, - positionSalaryAmount: profileSalary?.positionSalaryAmount, - mouthSalaryAmount: profileSalary?.mouthSalaryAmount, - posNo: profileSalary?.posNo, - position: profileSalary?.position, - positionType: profileSalary?.positionType, - positionLevel: profileSalary?.positionLevel, + amount: profileSalary?.amount ?? null, + positionSalaryAmount: profileSalary?.positionSalaryAmount ?? null, + mouthSalaryAmount: profileSalary?.mouthSalaryAmount ?? null, + posNo: profileSalary?.posNo ?? null, + position: profileSalary?.position ?? null, + positionType: profileSalary?.positionType ?? null, + positionLevel: profileSalary?.positionLevel ?? null, refCommandNo: null, templateDoc: requestBody.leaveReason, - }); + return new HttpSuccess(); }