import { Module } from "../model/module"; import { Calendar } from "../model/calendar"; export async function getCalender(token: string): Promise { const request = new Request("/api/collections/feeds/records/" + token, { method: "GET", }); return await fetch(request).then((response) => { if (response.ok) { return response .json() .then((calendarResponse: Calendar) => calendarResponse.modules); } else { return []; } }); }