From ea315c3d8f4a99613dcd53a0931a23f3f6bf26f9 Mon Sep 17 00:00:00 2001 From: David Bayly Date: Wed, 21 Aug 2024 13:22:14 -0600 Subject: [PATCH] Made country of education optional, made tweak to sync --- apps/api/src/admin/dto/bccnm-ncas-update.dto.ts | 1 + apps/api/src/applicant/external-api.service.ts | 1 + apps/api/src/syncdata.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/api/src/admin/dto/bccnm-ncas-update.dto.ts b/apps/api/src/admin/dto/bccnm-ncas-update.dto.ts index 2ce507fe..952ea0bd 100644 --- a/apps/api/src/admin/dto/bccnm-ncas-update.dto.ts +++ b/apps/api/src/admin/dto/bccnm-ncas-update.dto.ts @@ -54,6 +54,7 @@ export class BccnmNcasUpdateItemDTO implements BccnmNcasValidation { description: `Country of Education`, }) @IsString() + @IsOptional() countryOfEducation?: string; @ApiModelProperty({ diff --git a/apps/api/src/applicant/external-api.service.ts b/apps/api/src/applicant/external-api.service.ts index 4cb86931..cbee649d 100644 --- a/apps/api/src/applicant/external-api.service.ts +++ b/apps/api/src/applicant/external-api.service.ts @@ -791,6 +791,7 @@ export class ExternalAPIService { } page = page + 5; } while ((!result?.done || !!result) && failCount < 5); + return result; } async getApplicants(filter: IENUserFilterAPIDTO): Promise { diff --git a/apps/api/src/syncdata.ts b/apps/api/src/syncdata.ts index afd5d6c0..5e91166e 100644 --- a/apps/api/src/syncdata.ts +++ b/apps/api/src/syncdata.ts @@ -45,7 +45,7 @@ export const handler: Handler = async (event, context: Context) => { page = event.page; } if (process.env.PROTOTYPE_SYNC && !page) { - await externalAPIService.saveApplicant(from, to); + await externalAPIService.slicedSync(from, to); } else { await externalAPIService.saveApplicant(from, to, page); }