forked from Ivasoft/mattermost-mobile
* Add hitSlop to navigation header right buttons * Fix channel_item info muted style * Fix team switch when global threads * Wrap WS channel events in try/catch * Group Box component and Animated Group Box * SlideUpPanelItem style * Fix return value of setCurrentTeamAndChannelId * Add observeChannelSettings and include channel settings in prepareDeleteChannel * update OPTIONS_HEIGHT reference in find channels quick options * Fix DM limit in channel list * Fix category header style and translate default categories * Add snackbar for unmute/favorite/unfavorite * Add toggleFavoriteChannel remote action * Add makeDirectChannelVisible remote action * Use makeDirectChannelVisible in switchToChannelById and update toggleMuteChannel snackbar * Add channel actions common components * Update channel intro to use channel action common components * Rename ChannelDetails screen to ChannelInfo * Add channel quick actions * Update localization strings * Fix addChannelToDefaultCategory * Leave channel * Add localization strings * Fix snackBar screen event listener * Feedback review
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
export interface ClientCategoriesMix {
|
|
getCategories: (userId: string, teamId: string) => Promise<CategoriesWithOrder>;
|
|
getCategoriesOrder: (userId: string, teamId: string) => Promise<string[]>;
|
|
getCategory: (userId: string, teamId: string, categoryId: string) => Promise<Category>;
|
|
updateChannelCategories: (userId: string, teamId: string, categories: CategoryWithChannels[]) => Promise<CategoriesWithOrder>;
|
|
}
|
|
|
|
const ClientCategories = (superclass: any) => class extends superclass {
|
|
getCategories = async (userId: string, teamId: string) => {
|
|
return this.doFetch(
|
|
`${this.getCategoriesRoute(userId, teamId)}`,
|
|
{method: 'get'},
|
|
);
|
|
};
|
|
getCategoriesOrder = async (userId: string, teamId: string) => {
|
|
return this.doFetch(
|
|
`${this.getCategoriesOrderRoute(userId, teamId)}`,
|
|
{method: 'get'},
|
|
);
|
|
};
|
|
getCategory = async (userId: string, teamId: string, categoryId: string) => {
|
|
return this.doFetch(
|
|
`${this.getCategoryRoute(userId, teamId, categoryId)}`,
|
|
{method: 'get'},
|
|
);
|
|
};
|
|
|
|
updateChannelCategories = async (userId: string, teamId: string, categories: CategoryWithChannels[]) => {
|
|
return this.doFetch(
|
|
`${this.getCategoriesRoute(userId, teamId)}`,
|
|
{method: 'put', body: categories},
|
|
);
|
|
};
|
|
};
|
|
|
|
export default ClientCategories;
|