mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
user_groups: Pass correct group object for adding new group to UI.
We previously passed the UserGroupRaw type object received in the user group creation event to user_group_edit.add_group_to_table instead of the UserGroup type object. The add_group_to_table function is called after receiving creation event only, but other functions called later in the flow are called at other times as well like when opening edit panel for a particular group and they expect UserGroup type object, so this commit fixes it.
This commit is contained in:
@@ -39,7 +39,7 @@ export function init(): void {
|
||||
// WE INITIALIZE DATA STRUCTURES HERE!
|
||||
init();
|
||||
|
||||
export function add(user_group_raw: UserGroupRaw): void {
|
||||
export function add(user_group_raw: UserGroupRaw): UserGroup {
|
||||
// Reformat the user group members structure to be a set.
|
||||
const user_group = {
|
||||
description: user_group_raw.description,
|
||||
@@ -56,6 +56,7 @@ export function add(user_group_raw: UserGroupRaw): void {
|
||||
|
||||
user_group_name_dict.set(user_group.name, user_group);
|
||||
user_group_by_id_dict.set(user_group.id, user_group);
|
||||
return user_group;
|
||||
}
|
||||
|
||||
export function remove(user_group: UserGroup): void {
|
||||
|
||||
Reference in New Issue
Block a user