add events filter
This commit is contained in:
@@ -24,8 +24,10 @@ const actions = {
|
|||||||
changeSelectedRecordId({ commit }, id) {
|
changeSelectedRecordId({ commit }, id) {
|
||||||
commit("setSelectedRecordId", id);
|
commit("setSelectedRecordId", id);
|
||||||
},
|
},
|
||||||
getEvents({ commit }) {
|
getEvents({ commit, state }) {
|
||||||
fetchWrapper.get("events").then((data) => {
|
const start = state.selectedDates.from.toISOString();
|
||||||
|
const end = state.selectedDates.to.toISOString();
|
||||||
|
fetchWrapper.get(`events?start=${start}&end=${end}`).then((data) => {
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
commit("setEvents", data);
|
commit("setEvents", data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user