Commit 34ac2c84 authored by Thomas Randolph's avatar Thomas Randolph

Remove action error handling so errors can be handled inline

parent 2134f964
...@@ -37,17 +37,12 @@ export const postRuleSuccess = ({ dispatch }) => { ...@@ -37,17 +37,12 @@ export const postRuleSuccess = ({ dispatch }) => {
dispatch('fetchRules'); dispatch('fetchRules');
}; };
export const postRuleError = () => {
createFlash(__('An error occurred while updating approvers'));
};
export const postRule = ({ rootState, dispatch }, rule) => { export const postRule = ({ rootState, dispatch }, rule) => {
const { rulesPath } = rootState.settings; const { rulesPath } = rootState.settings;
return axios return axios
.post(rulesPath, mapApprovalRuleRequest(rule)) .post(rulesPath, mapApprovalRuleRequest(rule))
.then(() => dispatch('postRuleSuccess')) .then(() => dispatch('postRuleSuccess'));
.catch(() => dispatch('postRuleError'));
}; };
export const putRule = ({ rootState, dispatch }, { id, ...newRule }) => { export const putRule = ({ rootState, dispatch }, { id, ...newRule }) => {
...@@ -55,8 +50,7 @@ export const putRule = ({ rootState, dispatch }, { id, ...newRule }) => { ...@@ -55,8 +50,7 @@ export const putRule = ({ rootState, dispatch }, { id, ...newRule }) => {
return axios return axios
.put(`${rulesPath}/${id}`, mapApprovalRuleRequest(newRule)) .put(`${rulesPath}/${id}`, mapApprovalRuleRequest(newRule))
.then(() => dispatch('postRuleSuccess')) .then(() => dispatch('postRuleSuccess'));
.catch(() => dispatch('postRuleError'));
}; };
export const deleteRuleSuccess = ({ dispatch }) => { export const deleteRuleSuccess = ({ dispatch }) => {
...@@ -82,17 +76,12 @@ export const putFallbackRuleSuccess = ({ dispatch }) => { ...@@ -82,17 +76,12 @@ export const putFallbackRuleSuccess = ({ dispatch }) => {
dispatch('fetchRules'); dispatch('fetchRules');
}; };
export const putFallbackRuleError = () => {
createFlash(__('An error occurred while saving the approval settings'));
};
export const putFallbackRule = ({ rootState, dispatch }, fallback) => { export const putFallbackRule = ({ rootState, dispatch }, fallback) => {
const { projectPath } = rootState.settings; const { projectPath } = rootState.settings;
return axios return axios
.put(projectPath, mapApprovalFallbackRuleRequest(fallback)) .put(projectPath, mapApprovalFallbackRuleRequest(fallback))
.then(() => dispatch('putFallbackRuleSuccess')) .then(() => dispatch('putFallbackRuleSuccess'));
.catch(() => dispatch('putFallbackRuleError'));
}; };
export const requestEditRule = ({ dispatch }, rule) => { export const requestEditRule = ({ dispatch }, rule) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment