get calendars from API

This commit is contained in:
Jörn-Michael Miehe 2022-09-16 14:59:56 +00:00
parent e0ba5c0566
commit 9804fffbf2

View file

@ -169,6 +169,24 @@ export default class App extends Vue {
}); });
// Update Calendar Aggregates // Update Calendar Aggregates
this.api_query_simple_list("aggregate/list", (data) => {
let promises = data.map((name: string) =>
this.$axios.get(this.$ovdashboard.api_url("aggregate/get/" + name))
);
Promise.all(promises)
.then((responses) => {
this.calendar_data = [];
for (let i = 0; i < data.length; i++) {
this.calendar_data.push({
title: data[i],
events: responses[i].data,
});
}
})
.catch(this.fail("Calendar Aggregates"));
});
// Update Calendar Config // Update Calendar Config
this.api_query_simple_object("calendar/config", (data) => { this.api_query_simple_object("calendar/config", (data) => {