debian-mirror-gitlab/app/assets/javascripts/user_lists/store/new/actions.js

16 lines
571 B
JavaScript
Raw Normal View History

2021-01-03 14:25:43 +05:30
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))
2021-03-08 18:12:59 +05:30
.catch((response) => commit(types.RECEIVE_CREATE_USER_LIST_ERROR, getErrorMessages(response)));
2021-01-03 14:25:43 +05:30
};