แก้ SLR_018 , ลบ return id

This commit is contained in:
Bright 2024-02-27 17:14:22 +07:00
parent 1be7261ba0
commit 5f222498cb
6 changed files with 21 additions and 16 deletions

View file

@ -122,7 +122,7 @@ export class PosLevelController extends Controller {
) {
const posLevel = await this.posLevelRepository.findOne({ where: { id } });
if (!posLevel) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้");
}
const chkPosTypeId = await this.posTypeRepository.findOne({
@ -180,7 +180,7 @@ export class PosLevelController extends Controller {
async deleteLevel(@Path() id: string) {
const delPosLevel = await this.posLevelRepository.findOne({ where: { id } });
if (!delPosLevel) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้");
}
// try {
await this.posLevelRepository.remove(delPosLevel);
@ -217,7 +217,7 @@ export class PosLevelController extends Controller {
where: { id: id },
});
if (!getPosType) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้");
}
const mapPosLevel = {