blob: 0fdcbe25cec6d36b475718e4c503f3735f971d7e (
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
29
30
|
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) {
let message = error.error.response.data.ocs.meta.message;
OC.Notification.showHtml(t('settings','An error occured during the request. Unable to proceed.')+'<br>'+message, {timeout: 7});
// throw to raise exception of the promise and allow a `.then` in the Vue methods
console.log(state, error);
throw new Error(error);
}
};
export default new Vuex.Store({
modules: {
users,
settings,
oc
},
strict: debug,
mutations
});
|