From 9ca08b4640a628e8bbfb588a49f028c61e6bcf49 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 3 Jul 2024 18:08:47 +0700 Subject: [PATCH] validate --- src/controllers/SalaryController.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/controllers/SalaryController.ts b/src/controllers/SalaryController.ts index 25e3d75..f619ad5 100644 --- a/src/controllers/SalaryController.ts +++ b/src/controllers/SalaryController.ts @@ -252,17 +252,17 @@ export class SalaryController extends Controller { }); const formattedData = { - name: salary?.name, - isSpecial: salary?.isSpecial, - posTypeId: salary?.posTypeId, - posTypeName: salary?.posType_.posTypeName, - posLevelId: salary?.posLevelId, - posLevelName: salary?.posLevel_.posLevelName, - isActive: salary?.isActive, - date: salary?.date, - startDate: salary?.startDate, - endDate: salary?.endDate, - details: salary?.details, + name: salary?.name ?? null, + isSpecial: salary?.isSpecial ?? null, + posTypeId: salary?.posTypeId ?? null, + posTypeName: salary?.posType_.posTypeName ?? null, + posLevelId: salary?.posLevelId ?? null, + posLevelName: salary?.posLevel_.posLevelName ?? null, + isActive: salary?.isActive ?? null, + date: salary?.date ?? null, + startDate: salary?.startDate ?? null, + endDate: salary?.endDate ?? null, + details: salary?.details ?? null, }; if (!salary) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผังเงินเดือนนี้");