comment call leave service

This commit is contained in:
harid 2026-02-19 13:35:12 +07:00
parent 525a885e13
commit f1d9831055

View file

@ -5813,10 +5813,10 @@ export class CommandController extends Controller {
.orgRootShortName ?? ""; .orgRootShortName ?? "";
} }
} }
const leaveType = await this.leaveType.findOne({ // const leaveType = await this.leaveType.findOne({
select: { id: true, limit: true, code: true }, // select: { id: true, limit: true, code: true },
where: { code: "LV-005" } // where: { code: "LV-005" }
}); // });
await Promise.all( await Promise.all(
body.data.map(async (item) => { body.data.map(async (item) => {
const profile = await this.profileRepository.findOne({ const profile = await this.profileRepository.findOne({
@ -5912,25 +5912,25 @@ export class CommandController extends Controller {
{ id: In(profileIds) }, { id: In(profileIds) },
{ isProbation: false } { isProbation: false }
); );
// Task #2304 อัปเดตจำนวนสิทธิ์การลา เมื่อผ่านทดลองงานฯ // // Task #2304 อัปเดตจำนวนสิทธิ์การลา เมื่อผ่านทดลองงานฯ
if (leaveType != null) { // if (leaveType != null) {
await Promise.all( // await Promise.all(
body.data.map((item) => // body.data.map((item) =>
new CallAPI().PutData(req, `/leave-beginning/schedule`, { // new CallAPI().PutData(req, `/leave-beginning/schedule`, {
profileId: item.profileId, // profileId: item.profileId,
leaveTypeId: leaveType.id, // leaveTypeId: leaveType.id,
leaveYear: item.commandYear, // leaveYear: item.commandYear,
leaveDays: leaveType.limit, // leaveDays: leaveType.limit,
leaveDaysUsed: 0, // leaveDaysUsed: 0,
leaveCount: 0, // leaveCount: 0,
beginningLeaveDays: 0, // beginningLeaveDays: 0,
beginningLeaveCount: 0, // beginningLeaveCount: 0,
}) // })
.then(() => {}) // .then(() => {})
.catch(() => {}) // .catch(() => {})
) // )
); // );
} // }
} }
return new HttpSuccess(); return new HttpSuccess();
} }