diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx index 4fd35685fc..674e6d70a4 100644 --- a/apps/web/pages/event-types/index.tsx +++ b/apps/web/pages/event-types/index.tsx @@ -192,7 +192,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL } // inject selection data into url for correct router history - const openDuplicateModal = (eventType: EventType) => { + const openDuplicateModal = (eventType: EventType, group: EventTypeGroup) => { const query = { ...router.query, dialog: "duplicate-event-type", @@ -201,6 +201,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL slug: eventType.slug, id: eventType.id, length: eventType.length, + pageSlug: group.profile.slug, }; router.push( @@ -370,7 +371,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL type="button" data-testid={"event-type-duplicate-" + type.id} StartIcon={FiCopy} - onClick={() => openDuplicateModal(type)}> + onClick={() => openDuplicateModal(type, group)}> {t("duplicate")} @@ -477,7 +478,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL className="w-full rounded-none" data-testid={"event-type-duplicate-" + type.id} StartIcon={FiCopy} - onClick={() => openDuplicateModal(type)}> + onClick={() => openDuplicateModal(type, group)}> {t("duplicate")} diff --git a/packages/features/eventtypes/components/DuplicateDialog.tsx b/packages/features/eventtypes/components/DuplicateDialog.tsx index 25873bd648..9e3082d3eb 100644 --- a/packages/features/eventtypes/components/DuplicateDialog.tsx +++ b/packages/features/eventtypes/components/DuplicateDialog.tsx @@ -55,7 +55,8 @@ const DuplicateDialog = () => { }, }); - const pageSlug = router.query.eventPage; + const { pageSlug } = router.query; + return (