diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index e91bc9da..f2307a5a 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -310,13 +310,13 @@ export class ReportController extends Controller { if(!education && !educationLevel && !field) { _educations = Array.isArray(x.Educations) && x.Educations != null ? (x.Educations as any[]).filter( - (i: any) => i.isEducation === true + (i: any) => i.isEducation == true ) : [] if(_educations.length == 0) { _educations = Array.isArray(x.Educations) && x.Educations != null ? (x.Educations as any[]).filter( - (i: any) => i.isHigh === true + (i: any) => i.isHigh == true ) : [] // if(_educations.length == 0) { @@ -330,9 +330,12 @@ export class ReportController extends Controller { _educations = Array.isArray(x.Educations) && x.Educations != null ? (x.Educations as any[]).filter( (i: any) => - i.degree === education || - i.educationLevel === educationLevel || - i.field === field + // i.degree === education || + // i.educationLevel === educationLevel || + // i.field === field + (education ? i.degree?.toString().includes(education) : false) || + (educationLevel ? i.educationLevel?.toString().includes(educationLevel) : false) || + (field ? i.field?.toString().includes(field) : false) ) : [] } @@ -593,30 +596,25 @@ export class ReportController extends Controller { if(!education && !educationLevel && !field) { _educations = Array.isArray(x.Educations) && x.Educations != null ? (x.Educations as any[]).filter( - (i: any) => i.isEducation === true + (i: any) => i.isEducation == true ) : [] if(_educations.length == 0) { _educations = Array.isArray(x.Educations) && x.Educations != null ? (x.Educations as any[]).filter( - (i: any) => i.isHigh === true + (i: any) => i.isHigh == true ) : [] - // if(_educations.length == 0) { - // _educations = Array.isArray(x.Educations) && x.Educations != null - // ? (x.Educations as any[])[0] - // : [] - // } } } else { _educations = Array.isArray(x.Educations) && x.Educations != null ? (x.Educations as any[]).filter( (i: any) => - i.degree === education || - i.educationLevel === educationLevel || - i.field === field - ) + (education ? i.degree?.toString().includes(education) : false) || + (educationLevel ? i.educationLevel?.toString().includes(educationLevel) : false) || + (field ? i.field?.toString().includes(field) : false) + ) : [] } mapData.push({