get calendars from API
This commit is contained in:
parent
e0ba5c0566
commit
9804fffbf2
1 changed files with 18 additions and 0 deletions
|
@ -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) => {
|
||||||
|
|
Loading…
Reference in a new issue