[CSTPER-3620] Workflow Actions refresh entire MyDSpace page instead of just WorkflowItem

Merge cache part 2
This commit is contained in:
Alessandro Martelli
2021-02-09 14:42:38 +01:00
parent 807d4f5fc7
commit 5f6ad03f6f
9 changed files with 41 additions and 26 deletions

View File

@@ -131,14 +131,19 @@ export abstract class TasksService<T extends CacheableObject> extends DataServic
* links to follow
*/
public searchTask(searchMethod: string, options: FindListOptions = {}, ...linksToFollow: FollowLinkConfig<T>[]): Observable<RemoteData<T>> {
const correlationId = Math.floor(Math.random() * 1000);
const hrefObs = this.getSearchByHref(searchMethod, options, ...linksToFollow);
return hrefObs.pipe(
tap(href => console.log('CorrelationId: ' + correlationId, 'SearchTaskHref', href)),
find((href: string) => hasValue(href)),
switchMap((href) => this.findByHref(href).pipe(
switchMap((href) => this.findByHref(href, false, true).pipe(
getFirstSucceededRemoteData(),
tap(() => {
this.requestService.setStaleByHrefSubstring(searchMethod);
}))),
tap((response) => {
console.log('CorrelationId: ' + correlationId, 'SearchTaskResponse', response.payload);
})
);
}
}