Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix(type): make dataroomId optional but validate

Marc Seitzbf601e28b544
diff --git a/lib/swr/use-brand.ts b/lib/swr/use-brand.ts
index f56426fe..bc5bc049 100644
--- a/lib/swr/use-brand.ts
+++ b/lib/swr/use-brand.ts
@@ -24,12 +24,18 @@ export function useBrand() {
};
}
-export function useDataroomBrand({ dataroomId }: { dataroomId: string }) {
+export function useDataroomBrand({
+ dataroomId,
+}: {
+ dataroomId: string | undefined;
+}) {
const teamInfo = useTeam();
const teamId = teamInfo?.currentTeam?.id;
const { data: brand, error } = useSWR<DataroomBrand>(
- teamId && `/api/teams/${teamId}/datarooms/${dataroomId}/branding`,
+ teamId &&
+ dataroomId &&
+ `/api/teams/${teamId}/datarooms/${dataroomId}/branding`,
fetcher,
{
dedupingInterval: 30000,