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/static_site_editor/store/actions.js')
-rw-r--r--app/assets/javascripts/static_site_editor/store/actions.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/assets/javascripts/static_site_editor/store/actions.js b/app/assets/javascripts/static_site_editor/store/actions.js
index 141148de1e0..c57ef86f6ef 100644
--- a/app/assets/javascripts/static_site_editor/store/actions.js
+++ b/app/assets/javascripts/static_site_editor/store/actions.js
@@ -3,6 +3,7 @@ import { __ } from '~/locale';
import * as mutationTypes from './mutation_types';
import loadSourceContent from '~/static_site_editor/services/load_source_content';
+import submitContentChanges from '~/static_site_editor/services/submit_content_changes';
export const loadContent = ({ commit, state: { sourcePath, projectId } }) => {
commit(mutationTypes.LOAD_CONTENT);
@@ -19,4 +20,15 @@ export const setContent = ({ commit }, content) => {
commit(mutationTypes.SET_CONTENT, content);
};
+export const submitChanges = ({ state: { projectId, content, sourcePath, username }, commit }) => {
+ commit(mutationTypes.SUBMIT_CHANGES);
+
+ return submitContentChanges({ content, projectId, sourcePath, username })
+ .then(data => commit(mutationTypes.SUBMIT_CHANGES_SUCCESS, data))
+ .catch(error => {
+ commit(mutationTypes.SUBMIT_CHANGES_ERROR);
+ createFlash(error.message);
+ });
+};
+
export default () => {};