เพิ่มฟิวคุณสมบัติบุคคล

This commit is contained in:
Kittapath 2024-03-07 15:28:08 +07:00
parent c94d3eb547
commit 07c310ae26
2 changed files with 23 additions and 18 deletions

View file

@ -199,9 +199,10 @@ export class OrganizationUnauthorizeController extends Controller {
child4: item.orgChild4?.orgChild4Name ? item.orgChild4.orgChild4Name : null, child4: item.orgChild4?.orgChild4Name ? item.orgChild4.orgChild4Name : null,
result: null, result: null,
duration: null, duration: null,
punish: null, isPunish: false,
retired: null, isSuspension: false,
retired2: null, isAbsent: false,
isLeave: false,
isRetired: false, isRetired: false,
}; };
}); });

View file

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