mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
teams: moved logic for searchteams to backend
This commit is contained in:
committed by
Leonard Gram
parent
782b5b6a3a
commit
b60e71c28b
@@ -1,9 +1,8 @@
|
||||
import { ThunkAction } from 'redux-thunk';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { OrgRole, StoreState, Team, TeamGroup, TeamMember } from 'app/types';
|
||||
import { StoreState, Team, TeamGroup, TeamMember } from 'app/types';
|
||||
import { updateNavIndex, UpdateNavIndexAction } from 'app/core/actions';
|
||||
import { buildNavModel } from './navModel';
|
||||
import { contextSrv } from '../../../core/services/context_srv';
|
||||
|
||||
export enum ActionTypes {
|
||||
LoadTeams = 'LOAD_TEAMS',
|
||||
@@ -86,8 +85,7 @@ export const setSearchQuery = (searchQuery: string): SetSearchQueryAction => ({
|
||||
|
||||
export function loadTeams(): ThunkResult<void> {
|
||||
return async dispatch => {
|
||||
const showMine = contextSrv.user.orgRole === OrgRole.Editor;
|
||||
const response = await getBackendSrv().get('/api/teams/search', { perpage: 1000, page: 1, showMine });
|
||||
const response = await getBackendSrv().get('/api/teams/search', { perpage: 1000, page: 1 });
|
||||
dispatch(teamsLoaded(response.teams));
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user