แก้ 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

@ -84,7 +84,7 @@ export class SalaryRanksController extends Controller {
// try {
const salaryRank = await this.salaryRankRepository.findOne({ where: { id: id } });
if (!salaryRank) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้");
}
salaryRank.lastUpdateUserId = request.user.sub;
salaryRank.lastUpdateFullName = request.user.name;
@ -110,7 +110,7 @@ export class SalaryRanksController extends Controller {
where: { id },
});
if (!delSalaryRanks) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id);
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้");
}
await this.salaryRankRepository.delete({ id: id });
return new HttpSuccess();