* Move managers to their own folder * Fix lint * Fix unit tests Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
16 lines
504 B
TypeScript
16 lines
504 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {Client} from '@client/rest';
|
|
import NetworkManager from '@managers/network_manager';
|
|
|
|
export const getGroupsForAutocomplete = async (serverUrl: string, channelId: string) => {
|
|
let client: Client;
|
|
try {
|
|
client = NetworkManager.getClient(serverUrl);
|
|
} catch (error) {
|
|
return [];
|
|
}
|
|
|
|
return client.getAllGroupsAssociatedToChannel(channelId, true);
|
|
};
|