no message

This commit is contained in:
Kittapath 2024-02-07 14:01:39 +07:00
parent 148fa2c81c
commit d33569005a
2 changed files with 150 additions and 112 deletions

View file

@ -86,27 +86,26 @@ export class PositionController extends Controller {
}
const checkPosTypeId = await this.posTypeRepository.findOne({
where: { id: requestBody.posTypeId },
where: { id: posDict.posTypeId },
});
if (!checkPosTypeId) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล PosTypeId");
}
const checkPosLevelId = await this.posLevelRepository.findOne({
where: { id: requestBody.posLevelId },
where: { id: posDict.posLevelId },
});
if (!checkPosLevelId) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล PosLevelId");
}
if (requestBody.posExecutiveId == "") {
requestBody.posExecutiveId = null;
if (posDict.posExecutiveId == "") {
posDict.posExecutiveId = null;
}
if (requestBody.posExecutiveId != null) {
if (posDict.posExecutiveId != null) {
const checkPosExecutiveId = await this.posExecutiveRepository.findOne({
where: { id: requestBody.posExecutiveId },
where: { id: posDict.posExecutiveId },
});
if (!checkPosExecutiveId) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล PosExecutiveId");