ออกคำสั่ง
This commit is contained in:
parent
b9bc5b1298
commit
e0672ceca0
3 changed files with 656 additions and 18 deletions
|
|
@ -5746,26 +5746,14 @@ export class ProfileController extends Controller {
|
|||
where: { id: id },
|
||||
});
|
||||
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
const _null: any = null;
|
||||
|
||||
profile.isLeave = requestBody.isLeave;
|
||||
profile.leaveReason = requestBody.leaveReason;
|
||||
profile.dateLeave = requestBody.dateLeave;
|
||||
if (requestBody.isLeave == true) {
|
||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||
}
|
||||
if (requestBody.leaveReason != undefined && requestBody.leaveReason != null) {
|
||||
profile.leaveReason = requestBody.leaveReason;
|
||||
} else {
|
||||
profile.leaveReason = _null;
|
||||
}
|
||||
if (requestBody.dateLeave != undefined && requestBody.dateLeave != null) {
|
||||
profile.dateLeave = requestBody.dateLeave;
|
||||
} else {
|
||||
profile.dateLeave = _null;
|
||||
}
|
||||
await this.profileRepo.save(profile);
|
||||
// const profileSalary = await this.salaryRepository.findOne({
|
||||
// where: { profileId: id },
|
||||
// order: { createdAt: "DESC" },
|
||||
// });
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue