[#741] separation of base eventAPI to EventDao and eventApi (#812)

This commit is contained in:
Camille Moussu
2026-04-21 11:20:44 +02:00
committed by GitHub
parent 1a2e538d04
commit 7f922cbea1
14 changed files with 657 additions and 425 deletions
+7 -5
View File
@@ -1,6 +1,8 @@
import { getFreeBusyForAddedAttendeesREPORT } from '@/features/Events/api/getFreeBusyForAddedAttendeesREPORT'
import { getFreeBusyForEventAttendeesPOST } from '@/features/Events/api/getFreeBusyForEventAttendeesPOST'
import { getUserDataFromEmail } from '@/features/Events/api/getUserDataFromEmail'
import {
getFreeBusyForAddedAttendee,
getFreeBusyForEventAttendees
} from '@/features/Events/FreeBusyApi'
import { getUserDataFromEmail } from '@/features/User/userAPI'
import moment from 'moment-timezone'
import { useEffect, useRef, useState } from 'react'
@@ -150,7 +152,7 @@ export function useAttendeesFreeBusy({
setStatusMap(prev => ({ ...prev, ...toLoadingMap(existingAttendees) }))
fetchFreeBusyMap(existingAttendees, resolved =>
getFreeBusyForEventAttendeesPOST(
getFreeBusyForEventAttendees(
resolved.map(r => r.userId),
toUtcIcal(start, timezone),
toUtcIcal(end, timezone),
@@ -208,7 +210,7 @@ export function useAttendeesFreeBusy({
Promise.all(
resolved.map(async ({ email, userId }) => {
try {
const busy = await getFreeBusyForAddedAttendeesREPORT(
const busy = await getFreeBusyForAddedAttendee(
userId,
moment.tz(start, timezone).utc().format('YYYYMMDDTHHmmss'),
moment.tz(end, timezone).utc().format('YYYYMMDDTHHmmss')