* Add User Mention to autocomplete * Minor fixes * Fix at_mention (you) alignment * Add missing translation strings * Make it more parallel to channel mentions * Fix bot tag Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
16 lines
500 B
TypeScript
16 lines
500 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 '@init/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);
|
|
};
|