mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
renaming vuejs root dir
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import 'es6-promise/auto';
|
||||
import { createStore } from 'vuex';
|
||||
import { getAccompanyingCourse, getParticipations } from '../api/accompanyingCourse';
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
|
||||
let promise = getAccompanyingCourse(window.accompanyingCourseId)
|
||||
.then(accompanying_course => new Promise((resolve, reject) => {
|
||||
let store = createStore({
|
||||
strict: debug,
|
||||
state: {
|
||||
accompanying_course: accompanying_course
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
mutations: {
|
||||
removeParticipation(state, item) {
|
||||
console.log('remove item', item.id);
|
||||
state.accompanying_course.participations = state.accompanying_course.participations.filter(participation => participation !== item)
|
||||
},
|
||||
addParticipation(state, item) {
|
||||
console.log('add new item');
|
||||
state.accompanying_course.participations.push(item)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
}
|
||||
});
|
||||
//console.log('store', store);
|
||||
resolve(store);
|
||||
}));
|
||||
|
||||
export default promise;
|
Reference in New Issue
Block a user