diff --git a/src/app/core/data-services/data.effects.ts b/src/app/core/data-services/data.effects.ts index 545ef6ec45993af7a6e0b1053c30a0bd10240b47..ee7318da12a6a40a6736b70ee4f5a81cf29d4bd0 100644 --- a/src/app/core/data-services/data.effects.ts +++ b/src/app/core/data-services/data.effects.ts @@ -30,7 +30,7 @@ export abstract class DataEffects<T extends CacheableObject> { protected findAll = this.actions$ .ofType(RequestCacheActionTypes.FIND_ALL_REQUEST) .filter((action: FindAllRequestCacheAction) => action.payload.service === this.dataService.name) - .switchMap((action: FindAllRequestCacheAction) => { + .flatMap((action: FindAllRequestCacheAction) => { //TODO scope, pagination, sorting -> when we know how that works in rest return this.restApi.get(this.getFindAllEndpoint(action)) .map((data: DSpaceRESTV2Response) => this.getSerializer().deserializeArray(data)) @@ -47,7 +47,7 @@ export abstract class DataEffects<T extends CacheableObject> { protected findById = this.actions$ .ofType(RequestCacheActionTypes.FIND_BY_ID_REQUEST) .filter((action: FindAllRequestCacheAction) => action.payload.service === this.dataService.name) - .switchMap((action: FindByIDRequestCacheAction) => { + .flatMap((action: FindByIDRequestCacheAction) => { return this.restApi.get(this.getFindByIdEndpoint(action)) .map((data: DSpaceRESTV2Response) => this.getSerializer().deserialize(data)) .do((t: T) => {