mattermost-mobile/app/actions/remote/groups.ts
Daniel Espino García 9f9190f5db
Add User Mention to autocomplete (#6005)
* 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>
2022-03-14 17:05:52 -03:00

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);
};