Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroHryshyn committed Jan 11, 2024
1 parent 78fff87 commit c5f0aaa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions apps/web/app/future/reschedule/[uid]/embed/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getServerSideProps } from "@pages/reschedule/[uid]";
import { withAppDir } from "app/AppDirSSRHOC";
import { withAppDirSsr } from "app/WithAppDirSsr";
import type { Params } from "next/dist/shared/lib/router/utils/route-matcher";
import { cookies, headers } from "next/headers";

Expand All @@ -12,8 +12,7 @@ type PageProps = Readonly<{

const Page = async ({ params }: PageProps) => {
const legacyCtx = buildLegacyCtx(headers(), cookies(), params);
// @ts-expect-error Argument of type '{ query: Params; params: Params; req: { headers: ReadonlyHeaders; cookies: ReadonlyRequestCookies; }; }'
await withAppDir(withEmbedSsr(getServerSideProps))(legacyCtx);
await withAppDirSsr(withEmbedSsr(getServerSideProps))(legacyCtx);

return null;
};
Expand Down
5 changes: 2 additions & 3 deletions apps/web/app/future/reschedule/[uid]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import OldPage, { getServerSideProps as _getServerSideProps } from "@pages/reschedule/[uid]";
import { withAppDir } from "app/AppDirSSRHOC";
import { withAppDirSsr } from "app/WithAppDirSsr";
import { _generateMetadata } from "app/_utils";
import type { Params } from "next/dist/shared/lib/router/utils/route-matcher";
import { headers, cookies } from "next/headers";
Expand All @@ -16,12 +16,11 @@ type PageProps = Readonly<{
params: Params;
}>;

const getData = withAppDir(_getServerSideProps);
const getData = withAppDirSsr(_getServerSideProps);

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

// @ts-expect-error Argument of type '{ query: Params; params: Params; req: { headers: ReadonlyHeaders; cookies: ReadonlyRequestCookies; }; }'
await getData(legacyCtx);

return <OldPage />;
Expand Down
1 change: 0 additions & 1 deletion apps/web/app/future/workflows/[workflow]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ async function getProps(context: GetServerSidePropsContext) {

export const generateStaticParams = () => [];

// @ts-expect-error getData arg
export default WithLayout({ getLayout: null, getData: getProps, Page: LegacyPage })<"P">;
export const dynamic = "force-static";
// generate segments on demand
Expand Down

0 comments on commit c5f0aaa

Please sign in to comment.