Commit e38a04ba by Torkel Ödegaard

Fixes issues with user and team picker

parent 3efaf520
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<Props, State> {
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 {
......
// Libraries
import React, { Component } from 'react';
import _ from 'lodash';
// Components
import { AsyncSelect } from './Select';
......@@ -38,6 +39,10 @@ export class UserPicker extends Component<Props, State> {
const backendSrv = getBackendSrv();
this.setState({ isLoading: true });
if (_.isNil(query)) {
query = '';
}
return backendSrv
.get(`/api/org/users?query=${query}&limit=10`)
.then(result => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment