comment validate fields PosExecutiveId

This commit is contained in:
Bright 2024-02-01 17:31:55 +07:00
parent 1c550a2f0c
commit 5e11dbba03

View file

@ -220,12 +220,12 @@ export class PositionController extends Controller {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล PosLevelId"); throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล PosLevelId");
} }
const checkPosExecutiveId = await this.posExecutiveRepository.findOne({ // const checkPosExecutiveId = await this.posExecutiveRepository.findOne({
where: { id: requestBody.posExecutiveId }, // where: { id: requestBody.posExecutiveId },
}); // });
if (!checkPosExecutiveId) { // if (!checkPosExecutiveId) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล PosExecutiveId"); // throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล PosExecutiveId");
} // }
try { try {
posDict.createdUserId = request.user.sub; posDict.createdUserId = request.user.sub;