return getJSON(url, data);
}
-export function simpleSearchProjects (data?: Object) {
- const url = '/api/projects/index';
- return getJSON(url, data).then(projects => projects.map(project => ({
- key: project.k,
- name: project.nm
- })));
-}
-
/**
* Change component's key
* @param {string} key
import differenceBy from 'lodash/differenceBy';
import ProjectNotifications from './ProjectNotifications';
import { translate } from '../../../helpers/l10n';
-import { simpleSearchProjects } from '../../../api/components';
+import { getComponents } from '../../../api/components';
import { getProjectsWithNotifications } from '../../../store/rootReducer';
type Props = {
loadOptions = query => {
// TODO filter existing out
- return simpleSearchProjects({ search: query })
+ return getComponents({ qualifiers: 'TRK', q: query })
+ .then(r => r.components)
.then(projects => projects.map(project => ({
value: project.key,
label: project.name