diff --git a/public/app/core/components/Select/TeamPicker.tsx b/public/app/core/components/Select/TeamPicker.tsx index 6449114cfff..bc608318806 100644 --- a/public/app/core/components/Select/TeamPicker.tsx +++ b/public/app/core/components/Select/TeamPicker.tsx @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import _ from 'lodash'; import { AsyncSelect } from './Select'; import { debounce } from 'lodash'; import { getBackendSrv } from 'app/core/services/backend_srv'; @@ -37,6 +38,10 @@ export class TeamPicker extends Component { const backendSrv = getBackendSrv(); this.setState({ isLoading: true }); + if (_.isNil(query)) { + query = ''; + } + return backendSrv.get(`/api/teams/search?perpage=10&page=1&query=${query}`).then(result => { const teams = result.teams.map(team => { return { diff --git a/public/app/core/components/Select/UserPicker.tsx b/public/app/core/components/Select/UserPicker.tsx index 976b32e47a9..8496d707105 100644 --- a/public/app/core/components/Select/UserPicker.tsx +++ b/public/app/core/components/Select/UserPicker.tsx @@ -1,5 +1,6 @@ // Libraries import React, { Component } from 'react'; +import _ from 'lodash'; // Components import { AsyncSelect } from './Select'; @@ -38,6 +39,10 @@ export class UserPicker extends Component { const backendSrv = getBackendSrv(); this.setState({ isLoading: true }); + if (_.isNil(query)) { + query = ''; + } + return backendSrv .get(`/api/org/users?query=${query}&limit=10`) .then(result => {