no message

This commit is contained in:
Kittapath 2024-03-18 11:35:36 +07:00
parent 8acd2a97c7
commit 85ba718bbd

View file

@ -64,10 +64,7 @@ export class PosLevelController extends Controller {
},
});
if (!chkPosTypeId) {
throw new HttpError(
HttpStatusCode.NOT_FOUND,
"ไม่พบข้อมูลประเภทตำแหน่งนี้"
);
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
}
const chkPosLevelName = await this.posLevelRepository.findOne({
@ -77,10 +74,7 @@ export class PosLevelController extends Controller {
},
});
if (chkPosLevelName) {
throw new HttpError(
HttpStatusCode.NOT_FOUND,
"ชื่อระดับตำแหน่งนี้มีอยู่ในระบบแล้ว",
);
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อระดับตำแหน่งนี้มีอยู่ในระบบแล้ว");
}
const validPosLevelAuthority = ["HEAD", "DEPUTY", "GOVERNOR"];
@ -127,10 +121,7 @@ export class PosLevelController extends Controller {
},
});
if (!chkPosTypeId) {
throw new HttpError(
HttpStatusCode.NOT_FOUND,
"ไม่พบข้อมูลประเภทตำแหน่งนี้"
);
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
}
const chkPosLevelName = await this.posLevelRepository.findOne({
@ -141,10 +132,7 @@ export class PosLevelController extends Controller {
},
});
if (chkPosLevelName) {
throw new HttpError(
HttpStatusCode.NOT_FOUND,
"ชื่อระดับตำแหน่งนี้มีอยู่ในระบบแล้ว",
);
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อระดับตำแหน่งนี้มีอยู่ในระบบแล้ว");
}
const validPosLevelAuthority = ["HEAD", "DEPUTY", "GOVERNOR"];
if (
@ -246,6 +234,7 @@ export class PosLevelController extends Controller {
const posLevel = await this.posLevelRepository.find({
select: ["id", "posLevelName", "posLevelRank", "posLevelAuthority", "posTypeId"],
relations: ["posType"],
order: { posLevelRank: "ASC" },
});
// if (!posLevel) {
// return new HttpSuccess([]);