API ตรวจสอบสถานะผู้สมัครสอบ #2518
All checks were successful
Build & Deploy on Dev / build (push) Successful in 58s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 58s
This commit is contained in:
parent
664f5153da
commit
825263c11c
1 changed files with 22 additions and 9 deletions
|
|
@ -9153,28 +9153,41 @@ export class OrganizationDotnetController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API ตรวจสอบ profileId ที่ลาออกแล้ว
|
* API ตรวจสอบสถานะผู้สมัครสอบ
|
||||||
* @summary API ตรวจสอบ profileId ที่ลาออกแล้ว
|
* @summary API ตรวจสอบสถานะผู้สมัครสอบ
|
||||||
*/
|
*/
|
||||||
@Post("check-isLeave")
|
@Post("check-isLeave")
|
||||||
@Security("internalAuth")
|
@Security("internalAuth")
|
||||||
async findProfileIsLeave(
|
async findProfileIsLeave(
|
||||||
@Body()
|
@Body()
|
||||||
req: { profileIds: string[] }
|
req: { citizenIds: string[] }
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.find({
|
|
||||||
select: { id: true },
|
const profiles = await this.profileRepo.find({
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
citizenId: true,
|
||||||
|
isLeave: true,
|
||||||
|
isActive: true
|
||||||
|
},
|
||||||
where: {
|
where: {
|
||||||
id: In(req.profileIds),
|
citizenId: In(req.citizenIds)
|
||||||
isLeave: true
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (profile.length === 0) {
|
if (profiles.length === 0) {
|
||||||
return new HttpSuccess([]);
|
return new HttpSuccess([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new HttpSuccess(
|
||||||
|
profiles.map(p => ({
|
||||||
|
citizenId: p.citizenId,
|
||||||
|
profileId: p.id,
|
||||||
|
isLeave: p.isLeave ?? false,
|
||||||
|
isActive: p.isActive ?? false
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
return new HttpSuccess(profile.map(p => p.id));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue