Ignore pagination when loading group data (#4644)

This commit is contained in:
Farhan Munshi 2020-08-07 09:31:26 -04:00 committed by GitHub
parent 48f1875cf1
commit 581e6ba12a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -616,7 +616,7 @@ function loadGroupData() {
} else {
const [getAllGroupsAssociatedToChannelsInTeam, getGroups] = await Promise.all([ //eslint-disable-line no-await-in-loop
Client4.getAllGroupsAssociatedToChannelsInTeam(team.id, true),
Client4.getGroups(true),
Client4.getGroups(true, 0, 0),
]);
if (getAllGroupsAssociatedToChannelsInTeam.groups) {

View file

@ -2850,9 +2850,9 @@ export default class Client4 {
);
};
getGroups = async (filterAllowReference = false) => {
getGroups = async (filterAllowReference = false, page = 0, perPage = PER_PAGE_DEFAULT) => {
return this.doFetch(
`${this.getBaseRoute()}/groups${buildQueryString({filter_allow_reference: filterAllowReference})}`,
`${this.getBaseRoute()}/groups${buildQueryString({filter_allow_reference: filterAllowReference, page, per_page: perPage})}`,
{method: 'get'},
);
};