2021-02-22 17:27:13 +05:30
|
|
|
import axios from 'axios';
|
|
|
|
import { refreshCurrentPage } from '~/lib/utils/url_utility';
|
2020-07-28 23:09:34 +05:30
|
|
|
import * as types from './mutation_types';
|
|
|
|
|
|
|
|
export const setOverride = ({ commit }, override) => commit(types.SET_OVERRIDE, override);
|
2020-11-24 15:15:51 +05:30
|
|
|
export const setIsSaving = ({ commit }, isSaving) => commit(types.SET_IS_SAVING, isSaving);
|
|
|
|
export const setIsTesting = ({ commit }, isTesting) => commit(types.SET_IS_TESTING, isTesting);
|
2021-01-29 00:20:46 +05:30
|
|
|
export const setIsResetting = ({ commit }, isResetting) =>
|
|
|
|
commit(types.SET_IS_RESETTING, isResetting);
|
2021-02-22 17:27:13 +05:30
|
|
|
|
|
|
|
export const requestResetIntegration = ({ commit }) => {
|
|
|
|
commit(types.REQUEST_RESET_INTEGRATION);
|
|
|
|
};
|
|
|
|
export const receiveResetIntegrationSuccess = () => {
|
|
|
|
refreshCurrentPage();
|
|
|
|
};
|
|
|
|
export const receiveResetIntegrationError = ({ commit }) => {
|
|
|
|
commit(types.RECEIVE_RESET_INTEGRATION_ERROR);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const fetchResetIntegration = ({ dispatch, getters }) => {
|
|
|
|
dispatch('requestResetIntegration');
|
|
|
|
|
|
|
|
return axios
|
|
|
|
.post(getters.propsSource.resetPath, { params: { format: 'json' } })
|
|
|
|
.then(() => dispatch('receiveResetIntegrationSuccess'))
|
|
|
|
.catch(() => dispatch('receiveResetIntegrationError'));
|
|
|
|
};
|