Skip to content

Commit 0964b76

Browse files
committed
chore: add missing headers
1 parent cd96d4c commit 0964b76

File tree

7 files changed

+22
-15
lines changed

7 files changed

+22
-15
lines changed

apps/captable/app/(authenticated)/(dashboard)/[publicId]/documents/[bucketId]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import { RiArrowLeftSLine } from "@remixicon/react";
99
import Link from "next/link";
1010
import { notFound } from "next/navigation";
1111
import { Fragment } from "react";
12+
import { headers } from "next/headers";
1213

1314
const DocumentPreview = async ({
1415
params,
1516
}: {
1617
params: Promise<{ publicId: string; bucketId: string }>;
1718
}) => {
1819
const { publicId, bucketId } = await params;
19-
const session = await useServerSideSession();
20+
const session = await useServerSideSession({ headers: await headers() });
2021
const companyId = session?.user?.companyId;
2122
const document = await db
2223
.select({

apps/captable/app/(authenticated)/(dashboard)/[publicId]/documents/esign/[templatePublicId]/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import { Badge } from "@/components/ui/badge";
55
import { TemplateFieldProvider } from "@/providers/template-field-provider";
66
import { useServerSideSession } from "@/hooks/use-server-side-session";
77
import { api } from "@/trpc/server";
8+
import { headers } from "next/headers";
89

910
const EsignTemplateDetailPage = async ({
1011
params,
1112
}: {
1213
params: Promise<{ templatePublicId: string }>;
1314
}) => {
1415
const { templatePublicId } = await params;
15-
const session = await useServerSideSession();
16+
const session = await useServerSideSession({ headers: await headers() });
1617

1718
const { name, status, url, fields, recipients } =
1819
await api.template.get.query({
@@ -23,7 +24,7 @@ const EsignTemplateDetailPage = async ({
2324
return (
2425
<TemplateFieldProvider recipients={recipients} fields={fields}>
2526
<TemplateFieldForm
26-
companyPublicId={session.user.companyPublicId}
27+
companyPublicId={session?.user?.companyPublicId ?? ""}
2728
templatePublicId={templatePublicId}
2829
>
2930
<div className="grid grid-cols-12">

apps/captable/app/(authenticated)/(dashboard)/[publicId]/documents/esign/page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import { RiUploadCloudLine } from "@remixicon/react";
77
import type { Metadata } from "next";
88
import { AddEsignDocumentButton } from "./components/add-esign-doc-button";
99
import { ESignTable } from "./components/table";
10+
import { headers } from "next/headers";
1011

1112
export const metadata: Metadata = {
1213
title: "Documents",
1314
};
1415

1516
const EsignDocumentPage = async () => {
16-
const session = await useServerSideSession();
17+
const session = await useServerSideSession({ headers: await headers() });
1718
const { documents } = await api.template.all.query();
1819

1920
if (documents.length === 0) {
@@ -26,7 +27,7 @@ const EsignDocumentPage = async () => {
2627
<AddEsignDocumentButton
2728
title="esign a Document"
2829
subtitle=""
29-
companyPublicId={session.user.companyPublicId}
30+
companyPublicId={session?.user?.companyPublicId ?? ""}
3031
/>
3132
</EmptyState>
3233
);
@@ -40,14 +41,14 @@ const EsignDocumentPage = async () => {
4041
<AddEsignDocumentButton
4142
title="esign a Document"
4243
subtitle=""
43-
companyPublicId={session.user.companyPublicId}
44+
companyPublicId={session?.user?.companyPublicId ?? ""}
4445
/>
4546
}
4647
>
4748
<Card className="mt-3">
4849
<div className="p-6">
4950
<ESignTable
50-
companyPublicId={session.user.companyPublicId}
51+
companyPublicId={session?.user?.companyPublicId ?? ""}
5152
documents={documents}
5253
/>
5354
</div>

apps/captable/app/(authenticated)/(dashboard)/[publicId]/documents/share/_page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ import { RiAddFill, RiUploadCloudLine } from "@remixicon/react";
88
import type { Metadata } from "next";
99
import DocumentUploadModal from "../components/modal";
1010
import DocumentsTable from "../components/table";
11+
import { headers } from "next/headers";
1112

1213
export const metadata: Metadata = {
1314
title: "Documents",
1415
};
1516

1617
const DocumentsPage = async () => {
1718
const documents = await api.document.getAll.query();
18-
const session = await useServerSideSession();
19+
const session = await useServerSideSession({ headers: await headers() });
1920

2021
if (documents.length === 0) {
2122
return (
@@ -25,7 +26,7 @@ const DocumentsPage = async () => {
2526
subtitle="Please click the button below to upload a new document."
2627
>
2728
<DocumentUploadModal
28-
companyPublicId={session.user.companyPublicId}
29+
companyPublicId={session?.user?.companyPublicId ?? ""}
2930
trigger={
3031
<Button>
3132
<RiAddFill className="mr-2 h-5 w-5" />
@@ -44,7 +45,7 @@ const DocumentsPage = async () => {
4445
description="Share pitch decks, financials, and any other important documents."
4546
action={
4647
<DocumentUploadModal
47-
companyPublicId={session.user.companyPublicId}
48+
companyPublicId={session?.user?.companyPublicId ?? ""}
4849
trigger={
4950
<Button>
5051
<RiAddFill className="mr-2 h-5 w-5" />
@@ -58,7 +59,7 @@ const DocumentsPage = async () => {
5859
<Card className="mt-3">
5960
<div className="p-6">
6061
<DocumentsTable
61-
companyPublicId={session.user.companyPublicId}
62+
companyPublicId={session?.user?.companyPublicId ?? ""}
6263
documents={documents}
6364
/>
6465
</div>

apps/captable/app/(authenticated)/(dashboard)/[publicId]/equity-plans/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { RiPieChart2Line } from "@remixicon/react";
99
import type { Metadata } from "next";
1010
import { CreateEquityPlanButton } from "./create-equity-plan-button";
1111
import EquityPlanTable from "./table";
12+
import { headers } from "next/headers";
1213

1314
export const metadata: Metadata = {
1415
title: "Equity plans",
@@ -29,7 +30,7 @@ const getShareClasses = async (companyId: string) => {
2930
};
3031

3132
const EquityPlanPage = async () => {
32-
const session = await useServerSideSession();
33+
const session = await useServerSideSession({ headers: await headers() });
3334
const companyId = session?.user?.companyId;
3435
let equityPlans: EquityPlanMutationType[] = [];
3536

@@ -40,7 +41,7 @@ const EquityPlanPage = async () => {
4041
}
4142

4243
const shareClasses: ShareClassMutationType[] = (await getShareClasses(
43-
companyId,
44+
companyId as string,
4445
)) as unknown as ShareClassMutationType[];
4546

4647
if (equityPlans.length === 0) {

apps/captable/app/(authenticated)/(dashboard)/[publicId]/share-classes/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { RiPieChart2Line } from "@remixicon/react";
77
import type { Metadata } from "next";
88
import { CreateShareButton } from "./create-share-class-button";
99
import ShareClassTable from "./table";
10+
import { headers } from "next/headers";
1011

1112
export const metadata: Metadata = {
1213
title: "Share classes",
@@ -20,7 +21,7 @@ const getShareClasses = async (companyId: string) => {
2021
};
2122

2223
const SharesPage = async () => {
23-
const session = await useServerSideSession();
24+
const session = await useServerSideSession({ headers: await headers() });
2425
const companyId = session?.user?.companyId;
2526
let shareClasses: ShareClassMutationType[] = [];
2627

apps/captable/components/security/SettingHeader.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useServerSideSession } from "@/hooks/use-server-side-session";
33
import { RiArrowLeftLine } from "@remixicon/react";
44
import Link from "next/link";
55
import type React from "react";
6+
import { headers } from "next/headers";
67

78
type SettingsHeaderProps = {
89
title: string;
@@ -19,7 +20,7 @@ export const SettingsHeader = async ({
1920
showBackArrow = true,
2021
className,
2122
}: SettingsHeaderProps) => {
22-
const session = await useServerSideSession();
23+
const session = await useServerSideSession({ headers: await headers() });
2324

2425
const href = `/${session?.user.companyPublicId}/settings/security`;
2526
return (

0 commit comments

Comments
 (0)