Commit 092d4ca6 authored by Fatih Acet's avatar Fatih Acet

IssueNotesRefactor: Move catch statements into main file to make ESLint happy.

It was happy before I don’t know what broke its heart.
parent ff6acdf1
<script>
/* global Flash */
import IssueNote from './issue_note.vue';
import UserAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
import IssueNoteHeader from './issue_note_header.vue';
......@@ -76,6 +78,9 @@ export default {
this.$store.dispatch('replyToDiscussion', data)
.then(() => {
this.isReplying = false;
})
.catch(() => {
new Flash('Something went wrong while adding your reply. Please try again.'); // eslint-disable-line
});
},
},
......
<script>
/* global Flash */
import UserAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
import IssueNoteHeader from './issue_note_header.vue';
import IssueNoteActions from './issue_note_actions.vue';
......@@ -50,6 +52,7 @@ export default {
this.isDeleting = false;
})
.catch(() => {
new Flash('Something went wrong while deleting your note. Please try again.'); // eslint-disable-line
this.isDeleting = false;
});
}
......
......@@ -20,7 +20,7 @@ export default {
type: String,
required: false,
default: 'Save comment',
}
},
},
data() {
return {
......
<script>
/* global Flash */
import Vue from 'vue';
import Vuex from 'vuex';
import storeOptions from '../stores/issue_notes_store';
......@@ -39,6 +41,9 @@ export default {
this.$store.dispatch('fetchNotes', path)
.then(() => {
this.isLoading = false;
})
.catch(() => {
new Flash('Something went wrong while fetching issue comments. Please try again.'); // eslint-disable-line
});
},
};
......
/* global Flash */
/* eslint-disable no-param-reassign */
import service from '../services/issue_notes_service';
......@@ -52,9 +51,6 @@ const actions = {
.then(res => res.json())
.then((res) => {
context.commit('setNotes', res);
})
.catch(() => {
new Flash('Something went wrong while fetching issue comments. Please try again.'); // eslint-disable-line
});
},
deleteNote(context, note) {
......@@ -62,9 +58,6 @@ const actions = {
.deleteNote(note.path)
.then(() => {
context.commit('deleteNote', note);
})
.catch(() => {
new Flash('Something went wrong while deleting your note. Please try again.'); // eslint-disable-line
});
},
replyToDiscussion(context, data) {
......@@ -72,12 +65,9 @@ const actions = {
return service
.replyToDiscussion(endpoint, reply)
.then((res) => res.json())
.then(res => res.json())
.then((res) => {
context.commit('addNewReplyToDiscussion', res);
})
.catch(() => {
new Flash('Something went wrong while adding your reply. Please try again.'); // eslint-disable-line
});
},
};
......
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