Ignore pagination when loading group data (#4644) (#4651)

(cherry picked from commit 581e6ba12a)

Co-authored-by: Farhan Munshi <3207297+fmunshi@users.noreply.github.com>
This commit is contained in:
Mattermost Build 2020-08-07 15:41:15 +02:00 committed by GitHub
parent 798bb45782
commit 66d730387e
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'},
);
};