Fix duplicate event modal page slug (#6657)
parent
425e18f53c
commit
b1c0ea4c38
|
@ -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")}
|
||||
</DropdownItem>
|
||||
</DropdownMenuItem>
|
||||
|
@ -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")}
|
||||
</Button>
|
||||
</DropdownMenuItem>
|
||||
|
|
|
@ -55,7 +55,8 @@ const DuplicateDialog = () => {
|
|||
},
|
||||
});
|
||||
|
||||
const pageSlug = router.query.eventPage;
|
||||
const { pageSlug } = router.query;
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
name="duplicate-event-type"
|
||||
|
|
Loading…
Reference in New Issue