fix ลบรายการกลุ่มงานลูกจ้างประจำ

This commit is contained in:
Bright 2024-12-25 12:24:32 +07:00
parent dcbda3b94e
commit 12ae8172d5

View file

@ -141,10 +141,11 @@ export class EmployeePosTypeController extends Controller {
async deleteType(@Path() id: string, @Request() request: RequestWithUser) { async deleteType(@Path() id: string, @Request() request: RequestWithUser) {
let result: any; let result: any;
try { try {
result = await this.employeePosTypeRepository.findOne({ // result = await this.employeePosTypeRepository.findOne({
where: { id: id }, // where: { id: id },
}); // });
await this.employeePosTypeRepository.remove(result, { data: request }); // await this.employeePosTypeRepository.remove(result, { data: request });
result = await this.employeePosTypeRepository.delete({ id: id });
} catch { } catch {
throw new HttpError( throw new HttpError(
HttpStatusCode.NOT_FOUND, HttpStatusCode.NOT_FOUND,