Skip to content

Commit 2a23aec

Browse files
committed
feat(es2): Fix overview page dropdown
1 parent 0baaaba commit 2a23aec

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎src/app/shared/stores/collections/collections.state.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Action, State, StateContext } from '@ngxs/store';
22

3-
import { catchError, forkJoin, of, switchMap, tap } from 'rxjs';
3+
import { catchError, forkJoin, map, of, switchMap, tap } from 'rxjs';
44

55
import { inject, Injectable } from '@angular/core';
66
import { Router } from '@angular/router';
@@ -116,7 +116,17 @@ export class CollectionsState {
116116
}
117117

118118
const submissionRequests = collections.map((collection) =>
119-
this.collectionsService.fetchCurrentSubmission(action.projectId, collection.id)
119+
this.collectionsService.fetchCurrentSubmission(action.projectId, collection.id).pipe(
120+
switchMap((submission) =>
121+
this.collectionsService.getCollectionProvider(submission.collectionId).pipe(
122+
map((provider) => ({
123+
...submission,
124+
requiredMetadataTemplateId: provider.requiredMetadataTemplate?.id ?? null,
125+
})),
126+
catchError(() => of(submission))
127+
)
128+
)
129+
)
120130
);
121131

122132
return forkJoin(submissionRequests);

0 commit comments

Comments
 (0)