mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-19 11:08:48 +02:00
added page and edit backend for edit calendar by token
This commit is contained in:
16
frontend/src/api/loadCalendar.ts
Normal file
16
frontend/src/api/loadCalendar.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { Module } from "../model/module";
|
||||
import { Calendar } from "../model/calendar";
|
||||
|
||||
export async function getCalender( token: string): Promise<Module[]> {
|
||||
const request = new Request("/api/collections/feeds/records/" + token, {
|
||||
method: "GET",
|
||||
});
|
||||
|
||||
return await fetch(request)
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
})
|
||||
.then(
|
||||
(calendarResponse: Calendar) => calendarResponse.modules
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user