Implemented update event systems
This commit is contained in:
@@ -83,7 +83,18 @@ export async function createCalendarEvent(eventData: CalendarEvent) {
|
||||
}
|
||||
|
||||
export async function editCalendarEvent(eventData: CalendarEvent) {
|
||||
let res = await fetch(`${addr}/calendar`, {
|
||||
method: "PUT",
|
||||
credentials: "include",
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(eventData)
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
return;
|
||||
} else {
|
||||
throw new Error(`Failed to set attendance: ${res.status} ${res.statusText}`);
|
||||
}
|
||||
}
|
||||
|
||||
export async function setCancelCalendarEvent(eventID: number, cancel: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user