user_groups: Rename can_mention_group_id parameter.

Earlier the API endpoints related to user_group accepts and returns a
field `can_mention_group_id` which represents the ID
of user_group whose members can mention the group.

This commit renames this field to `can_mention_group`.
This commit is contained in:
Ujjawal Modi
2023-07-14 10:20:33 +05:30
committed by Tim Abbott
parent c8bcb422f5
commit fbcc3b5c84
13 changed files with 74 additions and 47 deletions

View File

@@ -12,7 +12,7 @@ export type UserGroup = {
members: Set<number>;
is_system_group: boolean;
direct_subgroup_ids: Set<number>;
can_mention_group_id: number;
can_mention_group: number;
};
// The members field is a number array which we convert
@@ -46,7 +46,7 @@ export function add(user_group_raw: UserGroupRaw): void {
members: new Set(user_group_raw.members),
is_system_group: user_group_raw.is_system_group,
direct_subgroup_ids: new Set(user_group_raw.direct_subgroup_ids),
can_mention_group_id: user_group_raw.can_mention_group_id,
can_mention_group: user_group_raw.can_mention_group,
};
user_group_name_dict.set(user_group.name, user_group);
@@ -96,7 +96,7 @@ export function get_user_groups_allowed_to_mention(): UserGroup[] {
const user_groups = get_realm_user_groups();
return user_groups.filter((group) => {
const can_mention_group_id = group.can_mention_group_id;
const can_mention_group_id = group.can_mention_group;
return (
page_params.user_id !== undefined &&
is_user_in_group(can_mention_group_id, page_params.user_id)