forked from Ivasoft/mattermost-mobile
[Gekidou] Saves groups + group-channel for constrained channels (#6358)
* Rebases and addresses PR feedback * Rebased and addresses PR feedback * Checks group constraint in action instead * Update method docs, parallel promises * Parallel promises, method docs * Cleans up method docs * Method docs cleanup * Update app/database/operator/server_data_operator/handlers/group.ts Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import {Database, Q} from '@nozbe/watermelondb';
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
|
||||
import type GroupModel from '@typings/database/models/servers/group';
|
||||
import type GroupChannelModel from '@typings/database/models/servers/group_channel';
|
||||
import type GroupMembershipModel from '@typings/database/models/servers/group_membership';
|
||||
import type GroupTeamModel from '@typings/database/models/servers/group_team';
|
||||
|
||||
@@ -37,6 +38,12 @@ export const queryGroupsByNameInChannel = (database: Database, name: string, cha
|
||||
);
|
||||
};
|
||||
|
||||
export const queryGroupChannelForChannel = (database: Database, channelId: string) => {
|
||||
return database.collections.get<GroupChannelModel>(GROUP_CHANNEL).query(
|
||||
Q.where('channel_id', channelId),
|
||||
);
|
||||
};
|
||||
|
||||
export const queryGroupMembershipForMember = (database: Database, userId: string) => {
|
||||
return database.collections.get<GroupMembershipModel>(GROUP_MEMBERSHIP).query(
|
||||
Q.where('user_id', userId),
|
||||
|
||||
Reference in New Issue
Block a user