Skip to content

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

feat: add revalidation for error props

Marc Seitz50ad69c05489
diff --git a/pages/view/[linkId]/d/[documentId].tsx b/pages/view/[linkId]/d/[documentId].tsx
index 2d4de4dd..23529bc5 100644
--- a/pages/view/[linkId]/d/[documentId].tsx
+++ b/pages/view/[linkId]/d/[documentId].tsx
@@ -269,7 +269,7 @@ export async function getStaticProps(context: GetStaticPropsContext) {
};
} catch (error) {
console.error("Fetching error:", error);
- return { notFound: true };
+ return { props: { error: true }, revalidate: 30 };
}
}
diff --git a/pages/view/domains/[domain]/[slug]/d/[documentId].tsx b/pages/view/domains/[domain]/[slug]/d/[documentId].tsx
index a2b4b301..0acaabbf 100644
--- a/pages/view/domains/[domain]/[slug]/d/[documentId].tsx
+++ b/pages/view/domains/[domain]/[slug]/d/[documentId].tsx
@@ -288,7 +288,7 @@ export async function getStaticProps(context: GetStaticPropsContext) {
};
} catch (error) {
console.error("Fetching error:", error);
- return { notFound: true };
+ return { props: { error: true }, revalidate: 30 };
}
}