diff --git a/next.config.js b/next.config.js index 865a000366..c7cdd6b11f 100644 --- a/next.config.js +++ b/next.config.js @@ -33,11 +33,6 @@ module.exports = { permanent: false, }, // redirects to Gen2 for MVP August 2021 - { - source: '/organize/:orgId/people/:personId/edit', - destination: `http://organize.${process.env.ZETKIN_API_DOMAIN}/people/person%3A:personId/?org=:orgId`, - permanent: false, - }, { source: '/organize/:orgId(\\d{1,})', destination: '/legacy?orgId=:orgId', @@ -60,21 +55,6 @@ module.exports = { destination: '/legacy?path=/campaign/action%3A:eventId&orgId=:orgId', permanent: false, }, - { - source: '/o/:orgId', - destination: `http://${process.env.ZETKIN_API_DOMAIN}/o/:orgId`, - permanent: false, - }, - { - source: '/o/:orgId/events/:eventId', - destination: `http://${process.env.ZETKIN_API_DOMAIN}/o/:orgId`, - permanent: false, - }, - { - source: '/o/:orgId/projects/:campId', - destination: `http://${process.env.ZETKIN_API_DOMAIN}/o/:orgId/campaigns/:campId`, - permanent: false, - }, { source: '/organize/:orgId/campaigns/:path*', destination: '/organize/:orgId/projects/:path*', diff --git a/src/app/o/[orgId]/events/[eventId]/page.tsx b/src/app/o/[orgId]/events/[eventId]/page.tsx new file mode 100644 index 0000000000..9a593df21e --- /dev/null +++ b/src/app/o/[orgId]/events/[eventId]/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from 'next/navigation'; + +export default function Page({ params }: { params: { orgId: string } }) { + redirect(`http://${process.env.ZETKIN_API_DOMAIN}/o/${params.orgId}`); +} diff --git a/src/app/o/[orgId]/page.tsx b/src/app/o/[orgId]/page.tsx new file mode 100644 index 0000000000..9a593df21e --- /dev/null +++ b/src/app/o/[orgId]/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from 'next/navigation'; + +export default function Page({ params }: { params: { orgId: string } }) { + redirect(`http://${process.env.ZETKIN_API_DOMAIN}/o/${params.orgId}`); +} diff --git a/src/app/o/[orgId]/projects/[projId]/page.tsx b/src/app/o/[orgId]/projects/[projId]/page.tsx new file mode 100644 index 0000000000..f0f1f96233 --- /dev/null +++ b/src/app/o/[orgId]/projects/[projId]/page.tsx @@ -0,0 +1,12 @@ +import { redirect } from 'next/navigation'; + +export default function Page({ + params, +}: { + params: { orgId: string; projId: string }; +}) { + const { orgId, projId } = params; + redirect( + `http://${process.env.ZETKIN_API_DOMAIN}/o/${orgId}/campaigns/${projId}` + ); +} diff --git a/src/app/o/[orgId]/surveys/[surveyId]/page.tsx b/src/app/o/[orgId]/surveys/[surveyId]/page.tsx new file mode 100644 index 0000000000..028667ca73 --- /dev/null +++ b/src/app/o/[orgId]/surveys/[surveyId]/page.tsx @@ -0,0 +1,12 @@ +import { redirect } from 'next/navigation'; + +export default function Page({ + params, +}: { + params: { orgId: string; surveyId: string }; +}) { + const { orgId, surveyId } = params; + redirect( + `http://${process.env.ZETKIN_API_DOMAIN}/o/${orgId}/surveys/${surveyId}` + ); +} diff --git a/src/features/calendar/components/CalendarWeekView/index.tsx b/src/features/calendar/components/CalendarWeekView/index.tsx index 6074b20a1e..f19bda5903 100644 --- a/src/features/calendar/components/CalendarWeekView/index.tsx +++ b/src/features/calendar/components/CalendarWeekView/index.tsx @@ -254,6 +254,7 @@ const CalendarWeekView = ({ focusDate, onClickDay }: CalendarWeekViewProps) => { setGhostAnchorEl(null); await createEvent({ activity_id: null, + campaign_id: campId, end_time: pendingEvent[1].toISOString(), location_id: null, start_time: pendingEvent[0].toISOString(),