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

actions.js « store « static_site_editor « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 192345f37494d8398cdf3b1da9791428ce94925e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import createFlash from '~/flash';
import { __ } from '~/locale';

import * as mutationTypes from './mutation_types';
import loadSourceContent from '~/static_site_editor/services/load_source_content';

export const loadContent = ({ commit, state: { sourcePath, projectId } }) => {
  commit(mutationTypes.LOAD_CONTENT);

  return loadSourceContent({ sourcePath, projectId })
    .then(data => commit(mutationTypes.RECEIVE_CONTENT_SUCCESS, data))
    .catch(() => {
      commit(mutationTypes.RECEIVE_CONTENT_ERROR);
      createFlash(__('An error ocurred while loading your content. Please try again.'));
    });
};

export default () => {};