diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index 8dee46d4..1828bbdc 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -199,9 +199,10 @@ export class OrganizationUnauthorizeController extends Controller { child4: item.orgChild4?.orgChild4Name ? item.orgChild4.orgChild4Name : null, result: null, duration: null, - punish: null, - retired: null, - retired2: null, + isPunish: false, + isSuspension: false, + isAbsent: false, + isLeave: false, isRetired: false, }; }); diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 6e8f4adf..478cdf0e 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -57,7 +57,10 @@ export class ProfileController extends Controller { where: { citizenId: requestBody.citizenId }, }); if (_profile) { - throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว"); + throw new HttpError( + HttpStatusCode.INTERNAL_SERVER_ERROR, + "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว", + ); } if (requestBody.posLevelId == "") { requestBody.posLevelId = null; @@ -88,10 +91,7 @@ export class ProfileController extends Controller { }); if (checkCitizenId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว", - ); + throw new HttpError(HttpStatusCode.NOT_FOUND, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว"); } const profile = Object.assign(new Profile(), requestBody); @@ -126,7 +126,10 @@ export class ProfileController extends Controller { where: { id: Not(id), citizenId: requestBody.citizenId }, }); if (_profile) { - throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว"); + throw new HttpError( + HttpStatusCode.INTERNAL_SERVER_ERROR, + "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว", + ); } if (requestBody.posLevelId == "") { @@ -161,10 +164,7 @@ export class ProfileController extends Controller { }); if (checkCitizenId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว", - ); + throw new HttpError(HttpStatusCode.NOT_FOUND, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว"); } profile.lastUpdateUserId = request.user.sub; @@ -781,7 +781,10 @@ export class ProfileController extends Controller { where: { id: Not(id), citizenId: requestBody.citizenId }, }); if (profile) { - throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว"); + throw new HttpError( + HttpStatusCode.INTERNAL_SERVER_ERROR, + "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว", + ); } return new HttpSuccess(); } @@ -996,7 +999,7 @@ export class ProfileController extends Controller { { keyword: `%${body.keyword}%`, }, - ) + ); }), ) .skip((body.page - 1) * body.pageSize) @@ -1063,9 +1066,10 @@ export class ProfileController extends Controller { child4: item.orgChild4?.orgChild4Name ? item.orgChild4.orgChild4Name : null, result: null, duration: null, - punish: null, - retired: null, - retired2: null, + isPunish: false, + isSuspension: false, + isAbsent: false, + isLeave: false, isRetired: false, }; });