API ตรวจสอบสถานะผู้สมัครสอบ #2518
All checks were successful
Build & Deploy on Dev / build (push) Successful in 58s

This commit is contained in:
harid 2026-06-04 17:40:36 +07:00
parent 664f5153da
commit 825263c11c

View file

@ -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
}))
);
}
}