#601 event creation prefill resources (#641)

Co-authored-by: lethemanh <lethemanh@lethemanhs-MacBook-Pro.local>
This commit is contained in:
lethemanh
2026-03-18 17:31:29 +07:00
committed by GitHub
parent daf7257292
commit 3a84756872
9 changed files with 83 additions and 41 deletions
@@ -11,7 +11,10 @@ import {
import { getEvent } from "@/features/Events/EventApi";
import { CalendarEvent } from "@/features/Events/EventsTypes";
import { updateAttendeesAfterTimeChange } from "@/features/Events/updateEventHelpers/updateAttendeesAfterTimeChange";
import { createAttendee } from "@/features/User/models/attendee.mapper";
import {
AttendeeOptions,
createAttendee,
} from "@/features/User/models/attendee.mapper";
import { getDeltaInMilliseconds } from "@/utils/dateUtils";
import {
CalendarApi,
@@ -70,13 +73,18 @@ export const createEventHandlers = (props: EventHandlersProps) => {
end: selectInfo?.end
? formatLocalDateTime(selectInfo?.end, timezone)
: "",
attendee: tempUsers.map((user) =>
createAttendee({
attendee: tempUsers.map((user) => {
const attendeeOption: AttendeeOptions = {
cal_address: user.email,
cn: user.displayName,
rsvp: "TRUE",
})
),
};
if (user.objectType === "resource") {
attendeeOption.cutype = "RESOURCE";
}
return createAttendee(attendeeOption);
}),
} as CalendarEvent;
setTempEvent(newEvent);