Skip to content

Commit

Permalink
Restricted user acces to selected team members (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
venugopal1234567 authored Oct 16, 2023
1 parent 619082a commit 3664f0f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webapp/src/actions.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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);
};
}

Expand Down

0 comments on commit 3664f0f

Please sign in to comment.