Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
34ac2c84
Commit
34ac2c84
authored
Aug 17, 2020
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove action error handling so errors can be handled inline
parent
2134f964
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
14 deletions
+3
-14
ee/app/assets/javascripts/approvals/stores/modules/project_settings/actions.js
...ipts/approvals/stores/modules/project_settings/actions.js
+3
-14
No files found.
ee/app/assets/javascripts/approvals/stores/modules/project_settings/actions.js
View file @
34ac2c84
...
...
@@ -37,17 +37,12 @@ export const postRuleSuccess = ({ dispatch }) => {
dispatch
(
'
fetchRules
'
);
};
export
const
postRuleError
=
()
=>
{
createFlash
(
__
(
'
An error occurred while updating approvers
'
));
};
export
const
postRule
=
({
rootState
,
dispatch
},
rule
)
=>
{
const
{
rulesPath
}
=
rootState
.
settings
;
return
axios
.
post
(
rulesPath
,
mapApprovalRuleRequest
(
rule
))
.
then
(()
=>
dispatch
(
'
postRuleSuccess
'
))
.
catch
(()
=>
dispatch
(
'
postRuleError
'
));
.
then
(()
=>
dispatch
(
'
postRuleSuccess
'
));
};
export
const
putRule
=
({
rootState
,
dispatch
},
{
id
,
...
newRule
})
=>
{
...
...
@@ -55,8 +50,7 @@ export const putRule = ({ rootState, dispatch }, { id, ...newRule }) => {
return
axios
.
put
(
`
${
rulesPath
}
/
${
id
}
`
,
mapApprovalRuleRequest
(
newRule
))
.
then
(()
=>
dispatch
(
'
postRuleSuccess
'
))
.
catch
(()
=>
dispatch
(
'
postRuleError
'
));
.
then
(()
=>
dispatch
(
'
postRuleSuccess
'
));
};
export
const
deleteRuleSuccess
=
({
dispatch
})
=>
{
...
...
@@ -82,17 +76,12 @@ export const putFallbackRuleSuccess = ({ dispatch }) => {
dispatch
(
'
fetchRules
'
);
};
export
const
putFallbackRuleError
=
()
=>
{
createFlash
(
__
(
'
An error occurred while saving the approval settings
'
));
};
export
const
putFallbackRule
=
({
rootState
,
dispatch
},
fallback
)
=>
{
const
{
projectPath
}
=
rootState
.
settings
;
return
axios
.
put
(
projectPath
,
mapApprovalFallbackRuleRequest
(
fallback
))
.
then
(()
=>
dispatch
(
'
putFallbackRuleSuccess
'
))
.
catch
(()
=>
dispatch
(
'
putFallbackRuleError
'
));
.
then
(()
=>
dispatch
(
'
putFallbackRuleSuccess
'
));
};
export
const
requestEditRule
=
({
dispatch
},
rule
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment