Skip to content

Commit

Permalink
chore: app router - /reschedule pages (#18150)
Browse files Browse the repository at this point in the history
* app router - /reschedule pages

* add to config.matcher

* generateMetdata is not needed
  • Loading branch information
hbjORbj authored Dec 18, 2024
1 parent f78fca5 commit a7f24e7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { getServerSideProps as _getServerSideProps } from "@pages/reschedule/[uid]";
import { withAppDirSsr } from "app/WithAppDirSsr";
import withEmbedSsrAppDir from "app/WithEmbedSSR";
import type { PageProps } from "app/_types";
import { cookies, headers } from "next/headers";

import { buildLegacyCtx } from "@lib/buildLegacyCtx";
import withEmbedSsr from "@lib/withEmbedSsr";
import { getServerSideProps } from "@lib/reschedule/[uid]/getServerSideProps";

const getData = withEmbedSsr(_getServerSideProps);
const getData = withAppDirSsr(getServerSideProps);
const getEmbedData = withEmbedSsrAppDir(getData);

const Page = async ({ params, searchParams }: PageProps) => {
const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams);
await getData(legacyCtx);
await getEmbedData(legacyCtx);

return null;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import { withAppDirSsr } from "app/WithAppDirSsr";
import type { PageProps } from "app/_types";
import { _generateMetadata } from "app/_utils";
import { headers, cookies } from "next/headers";

import { buildLegacyCtx } from "@lib/buildLegacyCtx";
import { getServerSideProps } from "@lib/reschedule/[uid]/getServerSideProps";

export const generateMetadata = async () =>
await _generateMetadata(
() => "",
() => ""
);

const getData = withAppDirSsr(getServerSideProps);

const Page = async ({ params, searchParams }: PageProps) => {
Expand Down
1 change: 1 addition & 0 deletions apps/web/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export const config = {
"/teams",
"/future/teams/",
"/settings/:path*",
"/reschedule/:path*",
"/availability/:path*",
],
};
Expand Down
6 changes: 0 additions & 6 deletions apps/web/pages/reschedule/[uid].tsx

This file was deleted.

7 changes: 0 additions & 7 deletions apps/web/pages/reschedule/[uid]/embed.tsx

This file was deleted.

0 comments on commit a7f24e7

Please sign in to comment.