comment เครียร์ตำแหน่งลูกจ้างหลังลบออกจากครองตำแหน่ง

This commit is contained in:
Adisak 2025-10-02 15:18:48 +07:00
parent 5efb7346d6
commit 342c7dde67

View file

@ -2293,22 +2293,22 @@ export class EmployeePositionController extends Controller {
if (!dataMaster) { if (!dataMaster) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้"); throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้");
} }
if (dataMaster.current_holderId != null) { // if (dataMaster.current_holderId != null) {
const profile = await this.profileRepository.findOne({ // const profile = await this.profileRepository.findOne({
where: { // where: {
id: dataMaster.current_holderId, // id: dataMaster.current_holderId,
}, // },
}); // });
const _null: any = null; // const _null: any = null;
if (profile != null) { // if (profile != null) {
profile.posLevelId = _null; // profile.posLevelId = _null;
profile.posTypeId = _null; // profile.posTypeId = _null;
profile.position = _null; // profile.position = _null;
profile.employeeOc = _null; // profile.employeeOc = _null;
profile.positionEmployeePositionId = _null; // profile.positionEmployeePositionId = _null;
await this.profileRepository.save(profile); // await this.profileRepository.save(profile);
} // }
} // }
await this.employeePosMasterRepository.update(id, { await this.employeePosMasterRepository.update(id, {
isSit: false, isSit: false,