[FIX] Searching for users when creating Discussions (#4267)
This commit is contained in:
parent
5899b1f789
commit
a21c797886
|
@ -28,7 +28,7 @@ const SelectUsers = ({
|
||||||
try {
|
try {
|
||||||
const res = await search({ text: keyword, filterRooms: false });
|
const res = await search({ text: keyword, filterRooms: false });
|
||||||
const selectedUsers = users.filter((u: IUser) => selected.includes(u.name));
|
const selectedUsers = users.filter((u: IUser) => selected.includes(u.name));
|
||||||
const filteredUsers = res.filter(r => !users.find((u: IUser) => u.name === r.name));
|
const filteredUsers = res.filter(r => !selectedUsers.find((u: IUser) => u.name === r.name));
|
||||||
const items = [...selectedUsers, ...filteredUsers];
|
const items = [...selectedUsers, ...filteredUsers];
|
||||||
setUsers(items);
|
setUsers(items);
|
||||||
} catch {
|
} catch {
|
||||||
|
|
Loading…
Reference in New Issue