|
|
@@ -55,18 +55,6 @@ export const getPageDataForInitial = async (
|
|
|
return notFoundProps;
|
|
|
}
|
|
|
|
|
|
- // expired
|
|
|
- if (shareLink.isExpired()) {
|
|
|
- return {
|
|
|
- props: {
|
|
|
- isNotFound: false,
|
|
|
- pageWithMeta: null,
|
|
|
- isExpired: true,
|
|
|
- shareLink: shareLink.toObject(),
|
|
|
- },
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
const pageId = getIdStringForRef(shareLink.relatedPage);
|
|
|
const pageWithMeta = await pageService.findPageAndMetaDataByViewer(
|
|
|
pageId,
|
|
|
@@ -80,6 +68,23 @@ export const getPageDataForInitial = async (
|
|
|
return notFoundProps;
|
|
|
}
|
|
|
|
|
|
+ // expired
|
|
|
+ if (shareLink.isExpired()) {
|
|
|
+ const populatedPage =
|
|
|
+ await pageWithMeta.data.populateDataToShowRevision(true); //shouldExcludeBody = false,
|
|
|
+ return {
|
|
|
+ props: {
|
|
|
+ isNotFound: false,
|
|
|
+ pageWithMeta: {
|
|
|
+ data: populatedPage,
|
|
|
+ meta: pageWithMeta.meta,
|
|
|
+ },
|
|
|
+ isExpired: true,
|
|
|
+ shareLink: shareLink.toObject(),
|
|
|
+ },
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
// Handle existing page
|
|
|
const ssrMaxRevisionBodyLength = configManager.getConfig(
|
|
|
'app:ssrMaxRevisionBodyLength',
|