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 ที่ลาออกแล้ว
|
||||
* @summary API ตรวจสอบ profileId ที่ลาออกแล้ว
|
||||
* API ตรวจสอบสถานะผู้สมัครสอบ
|
||||
* @summary API ตรวจสอบสถานะผู้สมัครสอบ
|
||||
*/
|
||||
@Post("check-isLeave")
|
||||
@Security("internalAuth")
|
||||
async findProfileIsLeave(
|
||||
@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: {
|
||||
id: In(req.profileIds),
|
||||
isLeave: true
|
||||
citizenId: In(req.citizenIds)
|
||||
}
|
||||
});
|
||||
|
||||
if (profile.length === 0) {
|
||||
if (profiles.length === 0) {
|
||||
return new HttpSuccess([]);
|
||||
}
|
||||
|
||||
return new HttpSuccess(profile.map(p => p.id));
|
||||
return new HttpSuccess(
|
||||
profiles.map(p => ({
|
||||
citizenId: p.citizenId,
|
||||
profileId: p.id,
|
||||
isLeave: p.isLeave ?? false,
|
||||
isActive: p.isActive ?? false
|
||||
}))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue