Skip to content
Snippets Groups Projects
Commit 82426700 authored by Giuseppe Digilio's avatar Giuseppe Digilio
Browse files

Added getAuthorizedCollection method to CollectionDataService

parent 0ab2ca18
No related branches found
No related tags found
No related merge requests found
......@@ -41,11 +41,26 @@ export class CollectionDataService extends ComColDataService<Collection> {
super();
}
/**
* Get all collections whom user has authorization to submit
*
* @return Observable<RemoteData<PaginatedList<Collection>>>
* collection list
*/
getAuthorizedCollection(): Observable<RemoteData<PaginatedList<Collection>>> {
const searchHref = 'findAuthorized';
const options = new FindAllOptions();
options.elementsPerPage = 1000;
return this.searchBy(searchHref, options).pipe(
filter((collections: RemoteData<PaginatedList<Collection>>) => !collections.isResponsePending));
}
/**
* Get all collections whom user has authorization to submit to by community
*
* @return boolean
* true if the user has at least one collection to submit to
* @return Observable<RemoteData<PaginatedList<Collection>>>
* collection list
*/
getAuthorizedCollectionByCommunity(communityId): Observable<RemoteData<PaginatedList<Collection>>> {
const searchHref = 'findAuthorizedByCommunity';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment