Skip to content

Commit 2a94205

Browse files
117274: Fixed issue where getAuthorizedCollectionByCommunity passes its reRequestOnStale value to the searchBy's useCachedVersionIfAvailable parameter
1 parent 524b91e commit 2a94205

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/app/core/data/collection-data.service.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,20 @@ export class CollectionDataService extends ComColDataService<Collection> {
113113
/**
114114
* Get all collections the user is authorized to submit to, by community
115115
*
116+
* TODO This method should be replaced with `getAuthorizedCollection` and the `options` parameter `scopeID` should be
117+
* supported instead in `BaseDataService#buildHrefFromFindOptions`
118+
*
116119
* @param communityId The community id
117120
* @param query limit the returned collection to those with metadata values matching the query terms.
118121
* @param options The [[FindListOptions]] object
119-
* @param reRequestOnStale Whether or not the request should automatically be re-
120-
* requested after the response becomes stale
121-
* @return Observable<RemoteData<PaginatedList<Collection>>>
122-
* collection list
122+
* @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's no valid-cached
123+
* version. Defaults to true
124+
* @param reRequestOnStale Whether or not the request should automatically be re-requested after the response become
125+
* s stale
126+
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically
127+
* resolved
123128
*/
124-
getAuthorizedCollectionByCommunity(communityId: string, query: string, options: FindListOptions = {}, reRequestOnStale = true,): Observable<RemoteData<PaginatedList<Collection>>> {
129+
getAuthorizedCollectionByCommunity(communityId: string, query: string, options: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<Collection>[]): Observable<RemoteData<PaginatedList<Collection>>> {
125130
const searchHref = 'findSubmitAuthorizedByCommunity';
126131
options = Object.assign({}, options, {
127132
searchParams: [
@@ -130,9 +135,11 @@ export class CollectionDataService extends ComColDataService<Collection> {
130135
]
131136
});
132137

133-
return this.searchBy(searchHref, options, reRequestOnStale).pipe(
134-
filter((collections: RemoteData<PaginatedList<Collection>>) => !collections.isResponsePending));
138+
return this.searchBy(searchHref, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow).pipe(
139+
filter((collections: RemoteData<PaginatedList<Collection>>) => !collections.isResponsePending),
140+
);
135141
}
142+
136143
/**
137144
* Get all collections the user is authorized to submit to, by community and has the metadata
138145
*

0 commit comments

Comments
 (0)