[#31] fixed sending data

This commit is contained in:
Camille Moussu
2025-07-23 11:33:10 +02:00
parent b1ceebfc7d
commit 08789cb6f3
6 changed files with 61 additions and 111 deletions
+2 -9
View File
@@ -1,14 +1,14 @@
import { api } from "../../utils/apiUtils";
import { Calendars } from "../Calendars/CalendarTypes";
import { CalendarEvent } from "./EventsTypes";
import { calendarEventToICal, calendarEventToJCal } from "./eventUtils";
import { calendarEventToJCal } from "./eventUtils";
export async function putEvent(cal: Calendars, event: CalendarEvent) {
const response = await api(
`dav/calendars/${cal.id}/${event.uid.split(".")[0]}.isc`,
{
method: "PUT",
body: JSON.stringify(calendarEventToICal(cal, event)),
body: JSON.stringify(calendarEventToJCal(event)),
headers: {
"content-type": "text/calendar; charset=utf-8",
},
@@ -16,10 +16,3 @@ export async function putEvent(cal: Calendars, event: CalendarEvent) {
).json();
return response;
}
export async function getEvent(calID: string, eventID: string) {
const response = await api
.get(`dav/calendars/${calID}/${eventID}.ics`)
.json();
return response;
}