diff --git a/src/app/shared/services/student-profile.service.ts b/src/app/shared/services/student-profile.service.ts index 30e8112c0..a909926ef 100644 --- a/src/app/shared/services/student-profile.service.ts +++ b/src/app/shared/services/student-profile.service.ts @@ -167,6 +167,10 @@ export class StudentProfileService { .map((contract) => contract.JobTrainer) .filter((id): id is number => typeof id === 'number'); + if (ids.length === 0) { + return of([]); + } + return combineLatest(ids.map((id) => this.jobTrainersService.get(id))); } @@ -175,6 +179,10 @@ export class StudentProfileService { ): Observable> { const ids = contracts.map((contract) => contract.ApprenticeshipManagerId); + if (ids.length === 0) { + return of([]); + } + return combineLatest( ids.map((id) => this.apprenticeshipManagersService.get(id)) );