Welcome to mirror list, hosted at ThFree Co, Russian Federation.

actions.js « store « header_search « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3a86dcca409fa85adf517f60ecf716fd2b2fe5a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import axios from '~/lib/utils/axios_utils';
import * as types from './mutation_types';

export const fetchAutocompleteOptions = ({ commit, getters }) => {
  commit(types.REQUEST_AUTOCOMPLETE);
  return axios
    .get(getters.autocompleteQuery)
    .then(({ data }) => {
      commit(types.RECEIVE_AUTOCOMPLETE_SUCCESS, data);
    })
    .catch(() => {
      commit(types.RECEIVE_AUTOCOMPLETE_ERROR);
    });
};

export const clearAutocomplete = ({ commit }) => {
  commit(types.CLEAR_AUTOCOMPLETE);
};

export const setSearch = ({ commit }, value) => {
  commit(types.SET_SEARCH, value);
};