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