fix issues with repeatable fields

This commit is contained in:
Art Lowel
2020-04-01 11:06:31 +02:00
parent a8d5ad9c37
commit 2989ca4d96
21 changed files with 156 additions and 72 deletions

View File

@@ -1,6 +1,6 @@
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import { filter, find, flatMap, map, tap } from 'rxjs/operators';
import { filter, find, flatMap, map, take, tap } from 'rxjs/operators';
import { hasValue, hasValueOperator, isNotEmpty } from '../../shared/empty.util';
import { SearchResult } from '../../shared/search/search-result.model';
import { DSOSuccessResponse, RestResponse } from '../cache/response.models';
@@ -65,7 +65,7 @@ export const getPaginatedListPayload = () =>
export const getSucceededRemoteData = () =>
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
source.pipe(find((rd: RemoteData<T>) => rd.hasSucceeded));
source.pipe(filter((rd: RemoteData<T>) => rd.hasSucceeded), take(1));
/**
* Get the first successful remotely retrieved object