summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2019-01-25 18:35:05 +0000
committerPhil Hughes <me@iamphill.com>2019-01-25 18:35:05 +0000
commit7c7916baee74e2532e77a94b84e8775a6a8dc2e5 (patch)
tree9b5dd216201fabf56d92d6e17c147f2974a02b35 /app/assets
parentbf2fe35e2d65583022828d61766f7e63ca7d2670 (diff)
parent1b93b3b640c6dd6377bdddb8beb77f7c3d0da3fc (diff)
downloadgitlab-ce-7c7916baee74e2532e77a94b84e8775a6a8dc2e5.tar.gz
Merge branch 'osw-adjusts-suggestions-unable-to-be-applied' into 'master'
Adjusts suggestions unable to be applied Closes #56690 See merge request gitlab-org/gitlab-ce!24603
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/notes/stores/actions.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index 65f85314fa0..2105a62cecb 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -415,12 +415,13 @@ export const submitSuggestion = (
commit(types.APPLY_SUGGESTION, { discussionId, noteId, suggestionId });
callback();
})
- .catch(() => {
- Flash(
- __('Something went wrong while applying the suggestion. Please try again.'),
- 'alert',
- flashContainer,
+ .catch(err => {
+ const defaultMessage = __(
+ 'Something went wrong while applying the suggestion. Please try again.',
);
+ const flashMessage = err.response.data ? `${err.response.data.message}.` : defaultMessage;
+
+ Flash(__(flashMessage), 'alert', flashContainer);
callback();
});
};