summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/stores
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-08-08 14:54:43 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-08-08 14:54:58 +0100
commit15441f0ef564e87f2ffb672452b0fb9d7bd1d44e (patch)
tree614ab3c6053cf69db16055b43e2748da791661d2 /app/assets/javascripts/notes/stores
parentb1a2b43fbb324d471f1f906ffc17a091c72c54cc (diff)
downloadgitlab-ce-15441f0ef564e87f2ffb672452b0fb9d7bd1d44e.tar.gz
[ci skip] Init testing vue app for issue notes
Diffstat (limited to 'app/assets/javascripts/notes/stores')
-rw-r--r--app/assets/javascripts/notes/stores/actions.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index 1ad7648e533..bb9c2c53b79 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -87,7 +87,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
const commandsChanges = res.commands_changes;
if (hasQuickActions && Object.keys(errors).length) {
- dispatch('poll');
+ dispatch('fetchData');
$('.js-gfm-input').trigger('clear-commands-cache.atwho');
Flash('Commands applied', 'notice', $(noteData.flashContainer));
@@ -186,6 +186,15 @@ export const poll = ({ commit, state, getters }) => {
});
};
+export const fetchData = ({ commit, state, getters }) => {
+ const requestData = { endpoint: state.notesData.notesPath, lastFetchedAt: state.lastFetchedAt };
+
+ service.poll(requestData)
+ .then(resp => resp.json)
+ .then(data => pollSuccessCallBack(data, commit, state, getters))
+ .catch(() => Flash('Something went wrong while fetching latest comments.'));
+};
+
export const toggleAward = ({ commit, state, getters, dispatch }, { awardName, noteId }) => {
commit(types.TOGGLE_AWARD, { awardName, note: getters.notesById[noteId] });
};