Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/notes/stores/actions.js')
-rw-r--r--app/assets/javascripts/notes/stores/actions.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index a4b9c64645c..2e6719bb4fb 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -515,7 +515,7 @@ export const removeConvertedDiscussion = ({ commit }, noteId) =>
export const setCurrentDiscussionId = ({ commit }, discussionId) =>
commit(types.SET_CURRENT_DISCUSSION_ID, discussionId);
-export const fetchDescriptionVersion = ({ dispatch }, { endpoint, startingVersion }) => {
+export const fetchDescriptionVersion = ({ dispatch }, { endpoint, startingVersion, versionId }) => {
let requestUrl = endpoint;
if (startingVersion) {
@@ -526,7 +526,7 @@ export const fetchDescriptionVersion = ({ dispatch }, { endpoint, startingVersio
return axios
.get(requestUrl)
.then(res => {
- dispatch('receiveDescriptionVersion', res.data);
+ dispatch('receiveDescriptionVersion', { descriptionVersion: res.data, versionId });
})
.catch(error => {
dispatch('receiveDescriptionVersionError', error);
@@ -544,7 +544,10 @@ export const receiveDescriptionVersionError = ({ commit }, error) => {
commit(types.RECEIVE_DESCRIPTION_VERSION_ERROR, error);
};
-export const softDeleteDescriptionVersion = ({ dispatch }, { endpoint, startingVersion }) => {
+export const softDeleteDescriptionVersion = (
+ { dispatch },
+ { endpoint, startingVersion, versionId },
+) => {
let requestUrl = endpoint;
if (startingVersion) {
@@ -555,7 +558,7 @@ export const softDeleteDescriptionVersion = ({ dispatch }, { endpoint, startingV
return axios
.delete(requestUrl)
.then(() => {
- dispatch('receiveDeleteDescriptionVersion');
+ dispatch('receiveDeleteDescriptionVersion', versionId);
})
.catch(error => {
dispatch('receiveDeleteDescriptionVersionError', error);
@@ -566,8 +569,8 @@ export const softDeleteDescriptionVersion = ({ dispatch }, { endpoint, startingV
export const requestDeleteDescriptionVersion = ({ commit }) => {
commit(types.REQUEST_DELETE_DESCRIPTION_VERSION);
};
-export const receiveDeleteDescriptionVersion = ({ commit }) => {
- commit(types.RECEIVE_DELETE_DESCRIPTION_VERSION, __('Deleted'));
+export const receiveDeleteDescriptionVersion = ({ commit }, versionId) => {
+ commit(types.RECEIVE_DELETE_DESCRIPTION_VERSION, { [versionId]: __('Deleted') });
};
export const receiveDeleteDescriptionVersionError = ({ commit }, error) => {
commit(types.RECEIVE_DELETE_DESCRIPTION_VERSION_ERROR, error);