@@ -46,17 +46,27 @@ export class SiteDataService extends IdentifiableDataService<Site> implements Fi
4646
4747 /**
4848 * Retrieve the Site Object
49+ *
50+ * @param options Find list options object
51+ * @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's
52+ * no valid cached version. Defaults to true
53+ * @param reRequestOnStale Whether or not the request should automatically be re-
54+ * requested after the response becomes stale
55+ * @param linksToFollow List of {@link FollowLinkConfig} that indicate which
56+ * {@link HALLink}s should be automatically resolved
57+ * @return {Observable<RemoteData<PaginatedList<T>>> }
58+ * Return an observable that emits object list
4959 */
50- find ( ) : Observable < Site > {
60+ find ( options ?: FindListOptions , useCachedVersionIfAvailable ?: boolean , reRequestOnStale ?: boolean , ... linksToFollow : FollowLinkConfig < Site > [ ] ) : Observable < Site > {
5161 const searchParams : RequestParam [ ] = [ new RequestParam ( 'projection' , 'allLanguages' ) ] ;
52- const options = Object . assign ( new FindListOptions ( ) , { searchParams } ) ;
53- return this . findAll ( options ) . pipe (
62+ const findOptions = Object . assign ( new FindListOptions ( ) , options , { searchParams } ) ;
63+ return this . findAll ( findOptions , useCachedVersionIfAvailable , reRequestOnStale , ... linksToFollow ) . pipe (
5464 getFirstCompletedRemoteData ( ) ,
5565 switchMap ( ( remoteData : RemoteData < PaginatedList < Site > > ) => {
5666 if ( remoteData . hasSucceeded ) {
5767 return of ( remoteData . payload . page [ 0 ] ) ;
5868 } else {
59- return this . findAll ( ) . pipe (
69+ return this . findAll ( options , useCachedVersionIfAvailable , reRequestOnStale , ... linksToFollow ) . pipe (
6070 getFirstCompletedRemoteData ( ) ,
6171 map ( ( rd : RemoteData < PaginatedList < Site > > ) => rd . hasSucceeded ? rd . payload . page [ 0 ] : null )
6272 ) ;
0 commit comments