feat: allow delete event-type platform atoms (#17065)

* feat: allow delete event-type platform atoms

* fixup! feat: allow delete event-type platform atoms
This commit is contained in:
Morgan authored and GitHub committed 2024-10-15 14:40:57 +00:00
1 parent f0cfbede7e
commit 9c3f4ec055
5 files changed
+150 -43

No files matched your search

@@ -14,7 +14,11 @@ export default function Bookings(props: { calUsername: string; calEmail: string
const router = useRouter();
const { isLoading: isLoadingEvents, data: eventTypes, refetch } = useEventTypes(props.calUsername);
const { data: teams } = useTeams();
const { isLoading: isLoadingTeamEvents, data: teamEventTypes } = useTeamEventTypes(teams?.[0]?.id || 0);
const {
isLoading: isLoadingTeamEvents,
data: teamEventTypes,
refetch: refetchTeamEvents,
} = useTeamEventTypes(teams?.[0]?.id || 0);
const rescheduleUid = (router.query.rescheduleUid as string) ?? "";
return (
@@ -85,6 +89,7 @@ export default function Bookings(props: { calUsername: string; calEmail: string
{eventTypeId && (
<div>
<EventTypeSettings
allowDelete={true}
id={eventTypeId}
tabs={["setup", "limits", "recurring", "advanced"]}
onSuccess={(eventType) => {
@@ -96,6 +101,12 @@ export default function Bookings(props: { calUsername: string; calEmail: string
console.log(eventType);
console.error(error);
}}
onDeleteSuccess={() => {
refetch();
refetchTeamEvents();
setEventTypeId(null);
}}
onDeleteError={console.error}
/>
</div>
)}