Merge branch 'develop' into adiDev
This commit is contained in:
commit
823fcb8ea8
6 changed files with 294 additions and 6 deletions
|
|
@ -3019,4 +3019,29 @@ export class ProfileController extends Controller {
|
|||
});
|
||||
return new HttpSuccess(formattedData);
|
||||
}
|
||||
|
||||
/**
|
||||
* API อัพเดทเกษียณ
|
||||
*
|
||||
* @summary อัพเดทเกษียณ (ADMIN)
|
||||
*
|
||||
* @param {string} id Id ทะเบียนประวัติ
|
||||
*/
|
||||
@Put("salary/{id}")
|
||||
async updateLeaveUser(
|
||||
@Path() id: string,
|
||||
@Body()
|
||||
requestBody: { isLeave: boolean; leaveReason: string; dateLeave: Date },
|
||||
) {
|
||||
const profile = await this.profileRepo.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
||||
profile.isLeave = requestBody.isLeave;
|
||||
profile.leaveReason = requestBody.leaveReason;
|
||||
profile.dateLeave = requestBody.dateLeave;
|
||||
await this.profileRepo.save(profile);
|
||||
return new HttpSuccess();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue