ObservationDatabase/frontend/src/store.js

60 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-09-15 12:23:21 +01:00
import Vue from "vue";
import Vuex from "vuex";
var moment = require("moment");
2018-09-15 12:23:21 +01:00
Vue.use(Vuex);
export default new Vuex.Store({
state: {
site: null,
tutors: [],
description: null,
type: null,
whom: null,
search: {
site: null,
tutor: null,
whom: null,
person: null,
start: moment().subtract(7, "days"),
end: moment()
}
},
mutations: {
setSite(state, newSite) {
state.site = newSite;
},
setTutors(state, newTutors) {
state.tutors = newTutors;
},
setDescription(state, newDescription) {
state.description = newDescription;
},
2018-09-17 13:00:20 +01:00
setType(state, newType) {
state.type = newType;
2018-09-20 16:49:47 +01:00
},
setWhom(state, newWhom) {
state.whom = newWhom;
},
setSearchSite(state, data) {
state.search.site = data;
},
setSearchTutor(state, data) {
state.search.tutor = data;
},
setSearchWhom(state, data) {
state.search.whom = data;
},
setSearchPerson(state, data) {
state.search.person = data;
},
setSearchStartDate(state, data) {
state.search.start = data;
},
setSearchEndDate(state, data) {
state.search.end = data;
}
},
2018-09-15 12:23:21 +01:00
actions: {}
});