refactor to use store for storing events

This commit is contained in:
2022-05-17 16:57:31 +02:00
parent 9ceb66e2da
commit f68c69d443
11 changed files with 373 additions and 147 deletions

View File

@@ -4,6 +4,7 @@
* @returns {Promise} a promise containing all Calendar ranges objects
*/
const fetchCalendarRanges = () => {
return Promise.resolve([]);
const url = `/api/1.0/calendar/calendar-range-available.json`;
return fetch(url)
.then(response => {
@@ -13,6 +14,7 @@ const fetchCalendarRanges = () => {
};
const fetchCalendarRangesByUser = (userId) => {
return Promise.resolve([]);
const url = `/api/1.0/calendar/calendar-range-available.json?user=${userId}`;
return fetch(url)
.then(response => {
@@ -27,6 +29,7 @@ const fetchCalendarRangesByUser = (userId) => {
* @returns {Promise} a promise containing all Calendar objects
*/
const fetchCalendar = (mainUserId) => {
return Promise.resolve([]);
const url = `/api/1.0/calendar/calendar.json?main_user=${mainUserId}&item_per_page=1000`;
return fetch(url)
.then(response => {