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

actions.js « new « store « user_lists « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 185508bcfbc0af6ed22b7ffcbd63b6b38a882249 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Api from '~/api';
import { redirectTo } from '~/lib/utils/url_utility';
import { getErrorMessages } from '../utils';
import * as types from './mutation_types';

export const dismissErrorAlert = ({ commit }) => commit(types.DISMISS_ERROR_ALERT);

export const createUserList = ({ commit, state }, userList) => {
  return Api.createFeatureFlagUserList(state.projectId, {
    ...state.userList,
    ...userList,
  })
    .then(({ data }) => redirectTo(data.path))
    .catch(response => commit(types.RECEIVE_CREATE_USER_LIST_ERROR, getErrorMessages(response)));
};