From 3664f0f0776446b9f63880a11bfae3727bc26e5b Mon Sep 17 00:00:00 2001 From: venugopal1234567 <30863617+venugopal1234567@users.noreply.github.com> Date: Tue, 17 Oct 2023 01:54:09 +0530 Subject: [PATCH] Restricted user acces to selected team members (#172) --- webapp/src/actions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webapp/src/actions.js b/webapp/src/actions.js index 6aaa5432..3c1d29ef 100644 --- a/webapp/src/actions.js +++ b/webapp/src/actions.js @@ -1,4 +1,5 @@ import {Client4} from 'mattermost-redux/client'; +import * as TeamSelector from 'mattermost-redux/selectors/entities/teams'; import * as UserActions from 'mattermost-redux/actions/users'; import { @@ -202,9 +203,10 @@ export const bump = (id) => async (dispatch, getState) => { }; export function autocompleteUsers(username) { - return async (doDispatch) => { - const {data} = await doDispatch(UserActions.autocompleteUsers(username)); - return data.users; + return async (doDispatch, getState) => { + const team = TeamSelector.getCurrentTeam(getState()); + const {data} = await doDispatch(UserActions.autocompleteUsers(username, team.id)); + return data.users.filter((user) => user.delete_at === 0); }; }