mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Vuex Structure (#8054)
* wip: vuex structure * add missing files * client: do not fail dev build on eslint error * eslint does not block compilation, mount app when data is ready * eslintrc.js -> eslintrc
This commit is contained in:
15
website/client/vuex/actions.js
Normal file
15
website/client/vuex/actions.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
export function setTitle (store, title) {
|
||||
store.commit('SET_TITLE', title);
|
||||
}
|
||||
|
||||
export function fetchUser (store) {
|
||||
let promise = Vue.http.get('/api/v3/user');
|
||||
|
||||
promise.then(response => {
|
||||
store.commit('SET_USER', response.body.data);
|
||||
});
|
||||
|
||||
return promise;
|
||||
}
|
||||
Reference in New Issue
Block a user