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

actions.js « cluster_dropdown « store « eks_cluster « create_cluster « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4f1ecb227192ec528878a757259cf4cc491045e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import * as types from './mutation_types';

export default fetchItems => ({
  requestItems: ({ commit }) => commit(types.REQUEST_ITEMS),
  receiveItemsSuccess: ({ commit }, payload) => commit(types.RECEIVE_ITEMS_SUCCESS, payload),
  receiveItemsError: ({ commit }, payload) => commit(types.RECEIVE_ITEMS_ERROR, payload),
  fetchItems: ({ dispatch }) => {
    dispatch('requestItems');

    return fetchItems()
      .then(items => dispatch('receiveItemsSuccess', { items }))
      .catch(error => dispatch('receiveItemsError', { error }));
  },
});