Skip to content

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

fixed error handling of documents/[id] page

Nidhish Srivastava562b476f14f3
diff --git a/pages/documents/[id]/index.tsx b/pages/documents/[id]/index.tsx
index 64beeb21..00e9ad1e 100644
--- a/pages/documents/[id]/index.tsx
+++ b/pages/documents/[id]/index.tsx
@@ -18,14 +18,19 @@ import { useDocument, useDocumentLinks } from "@/lib/swr/use-document";
export default function DocumentPage() {
const { document: prismaDocument, primaryVersion, error } = useDocument();
+
const { links } = useDocumentLinks();
const teamInfo = useTeam();
-
+
const [isLinkSheetOpen, setIsLinkSheetOpen] = useState<boolean>(false);
if (error && error.status === 404) {
return <ErrorPage statusCode={404} />;
}
+
+ if (error && error.status === 400) {
+ return <ErrorPage statusCode={400} />;
+ }
return (
<AppLayout>