summaryrefslogtreecommitdiffstats
path: root/settings/src/store/index.js
blob: 43de49e2030abb38417d121949387ae47d9158e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import Vue from 'vue';
import Vuex from 'vuex';
import users from './users';
import settings from './settings';
import oc from './oc';

Vue.use(Vuex)

const debug = process.env.NODE_ENV !== 'production';

const mutations = {
	API_FAILURE(state, error) {
		OC.Notification.showTemporary(t('settings','An error occured during the request. Unable to proceed.'));
		// throw to raise exception of the promise and allow a `.then` in the Vue methods
		throw error;
	}
};

export default new Vuex.Store({
	modules: {
		users,
		settings,
		oc
	},
	strict: debug,

	mutations
});