Skip to content

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

fix: set revalidation on expired links

Marc Seitz371f83558d8a
diff --git a/pages/view/domains/[domain]/[slug]/d/[documentId].tsx b/pages/view/domains/[domain]/[slug]/d/[documentId].tsx
index b7d266d6..0bcbae9a 100644
--- a/pages/view/domains/[domain]/[slug]/d/[documentId].tsx
+++ b/pages/view/domains/[domain]/[slug]/d/[documentId].tsx
@@ -221,17 +221,17 @@ export async function getStaticProps(context: GetStaticPropsContext) {
dataroomDocumentId: documentId,
});
if (result.status !== "ok") {
- return { notFound: true };
+ return { notFound: true, revalidate: 10 };
}
const { linkType, link, brand } = result;
if (!link || !linkType) {
- return { notFound: true };
+ return { notFound: true, revalidate: 10 };
}
if (linkType !== "DATAROOM_LINK") {
- return { notFound: true };
+ return { notFound: true, revalidate: 10 };
}
let pageId = null;
@@ -247,6 +247,7 @@ export async function getStaticProps(context: GetStaticPropsContext) {
if (!notionPageId) {
return {
notFound: true,
+ revalidate: 10,
};
}
diff --git a/pages/view/domains/[domain]/[slug]/index.tsx b/pages/view/domains/[domain]/[slug]/index.tsx
index 0a1e8d14..e8977586 100644
--- a/pages/view/domains/[domain]/[slug]/index.tsx
+++ b/pages/view/domains/[domain]/[slug]/index.tsx
@@ -72,6 +72,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {
if (result.status !== "ok") {
return {
notFound: true,
+ revalidate: 10,
};
}
@@ -80,6 +81,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {
if (!linkType) {
return {
notFound: true,
+ revalidate: 10,
};
}
@@ -120,6 +122,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {
if (!link) {
return {
notFound: true,
+ revalidate: 10,
};
}
@@ -138,6 +141,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {
if (!notionPageId) {
return {
notFound: true,
+ revalidate: 10,
};
}