Skip to content

Commit

Permalink
Limit getMembers() and getSubgroups() to only fetching one object. Th…
Browse files Browse the repository at this point in the history
…ese lists are only used to find the size of each
  • Loading branch information
tdonohue committed Sep 20, 2023
1 parent 4171ccc commit f7182a3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/app/access-control/group-registry/groups-registry.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,28 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {

/**
* Get the members (epersons embedded value of a group)
* NOTE: At this time we only grab the *first* member in order to receive the `totalElements` value
* needed for our HTML template.
* @param group
*/
getMembers(group: Group): Observable<RemoteData<PaginatedList<EPerson>>> {
return this.ePersonDataService.findListByHref(group._links.epersons.href).pipe(getFirstSucceededRemoteData());
return this.ePersonDataService.findListByHref(group._links.epersons.href, {
currentPage: 1,
elementsPerPage: 1,
}).pipe(getFirstSucceededRemoteData());
}

/**
* Get the subgroups (groups embedded value of a group)
* NOTE: At this time we only grab the *first* subgroup in order to receive the `totalElements` value
* needed for our HTML template.
* @param group
*/
getSubgroups(group: Group): Observable<RemoteData<PaginatedList<Group>>> {
return this.groupService.findListByHref(group._links.subgroups.href).pipe(getFirstSucceededRemoteData());
return this.groupService.findListByHref(group._links.subgroups.href, {
currentPage: 1,
elementsPerPage: 1,
}).pipe(getFirstSucceededRemoteData());
}

/**
Expand Down

0 comments on commit f7182a3

Please sign in to comment.