แก้ SLR_018 , ลบ return id
This commit is contained in:
parent
1be7261ba0
commit
5f222498cb
6 changed files with 21 additions and 16 deletions
|
|
@ -132,7 +132,7 @@ export class Salary extends Controller {
|
|||
where: { id: id },
|
||||
});
|
||||
if (!chk_Salary) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี: " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี");
|
||||
}
|
||||
|
||||
if (chk_Salary.isActive && !requestBody.isActive) {
|
||||
|
|
@ -205,12 +205,11 @@ export class Salary extends Controller {
|
|||
where: { id: id },
|
||||
});
|
||||
if (!chk_Salary) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี: " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี");
|
||||
}
|
||||
if (chk_Salary.isActive) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่สามารถลบไอดี: " + id + " ได้ เนื่องสถานะการใช้งานที่เป็น Default",
|
||||
"ไม่สามารถลบข้อมูลนี้ได้ เนื่องจากเปิดใช้งานอยู่",
|
||||
);
|
||||
}
|
||||
|
|
@ -260,7 +259,7 @@ export class Salary extends Controller {
|
|||
],
|
||||
});
|
||||
if (!salary) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี: " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี");
|
||||
}
|
||||
return new HttpSuccess(salary);
|
||||
// } catch (error: any) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue