Change models, new migrations, fix front and make tests work

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-01-13 23:33:03 +01:00
parent 92d2045735
commit 20cd1bb579
186 changed files with 2982 additions and 3214 deletions

View File

@@ -1,21 +1,26 @@
import { LOGIN_USER, LOGOUT_USER, SAVE_USER } from './mutation-types';
import { LOGIN_USER, LOGOUT_USER, LOAD_USER } from './mutation-types';
const state = {
isLogged: !!localStorage.getItem('token'),
user: false,
};
/* eslint-disable */
const mutations = {
[LOGIN_USER](state) {
[LOGIN_USER](state, user) {
state.isLogged = true;
state.user = user;
},
[LOAD_USER](state, user) {
state.user = user;
},
[LOGOUT_USER](state) {
state.isLogged = false;
},
[SAVE_USER](state, user) {
state.user = user;
state.user = null;
},
};
/* eslint-enable */
export default { state, mutations };