From a150db82cd4c567e71f52ccad532704b426477e8 Mon Sep 17 00:00:00 2001 From: Camille Moussu Date: Wed, 23 Jul 2025 12:12:56 +0200 Subject: [PATCH] [#31] added repetition and all day to events to be sent --- src/features/Events/EventApi.ts | 10 ++++++ src/features/Events/EventModal.tsx | 49 ++++++++++++++++++++++++------ src/features/Events/EventsTypes.ts | 1 + src/features/Events/eventUtils.ts | 19 +++++++++--- 4 files changed, 65 insertions(+), 14 deletions(-) diff --git a/src/features/Events/EventApi.ts b/src/features/Events/EventApi.ts index 60bb186..02c35ee 100644 --- a/src/features/Events/EventApi.ts +++ b/src/features/Events/EventApi.ts @@ -16,3 +16,13 @@ export async function putEvent(cal: Calendars, event: CalendarEvent) { ).json(); return response; } + +export async function deleteEvent(calId: string, eventId: string) { + const response = await api( + `dav/calendars/${calId}/${eventId.split(".")[0]}.isc`, + { + method: "DELETE", + } + ).json(); + return response; +} diff --git a/src/features/Events/EventModal.tsx b/src/features/Events/EventModal.tsx index ca894a8..cbfa46a 100644 --- a/src/features/Events/EventModal.tsx +++ b/src/features/Events/EventModal.tsx @@ -18,6 +18,7 @@ import { import { Calendars } from "../Calendars/CalendarTypes"; import { putEvent } from "./EventApi"; import { TIMEZONES } from "../../utils/timezone-data"; +import { CheckBox, Repeat } from "@mui/icons-material"; function EventPopover({ anchorEl, @@ -50,6 +51,8 @@ function EventPopover({ const [start, setStart] = useState(""); const [end, setEnd] = useState(""); const [calendarid, setCalendarid] = useState(0); + const [allday, setAllDay] = useState(false); + const [repetition, setRepetition] = useState(""); const [timezone, setTimezone] = useState( Intl.DateTimeFormat().resolvedOptions().timeZone ); @@ -66,9 +69,11 @@ function EventPopover({ title, start: new Date(start), end: new Date(end), + allday, uid: crypto.randomUUID(), description, location, + repetition, organizer, timezone, attendee: [ @@ -113,6 +118,14 @@ function EventPopover({ Create Event + setTitle(e.target.value)} + size="small" + margin="dense" + /> Calendar setAllDay(!allday)} + /> + All day + + + Repetition + + + Time Zone