Просмотр исходного кода

include isEmpty into isNotFound

yuken 3 лет назад
Родитель
Сommit
f3e9333031
2 измененных файлов с 2 добавлено и 4 удалено
  1. 1 1
      packages/app/src/pages/[[...path]].page.tsx
  2. 1 3
      packages/app/src/stores/page.tsx

+ 1 - 1
packages/app/src/pages/[[...path]].page.tsx

@@ -418,7 +418,7 @@ async function injectRoutingInformation(context: GetServerSidePropsContext, prop
     props.isForbidden = count > 0;
   }
   else {
-    page.isNotFound = page.isEmpty;
+    props.isNotFound = page.isEmpty;
 
     // /62a88db47fed8b2d94f30000 ==> /path/to/page
     if (isPermalink && page.isEmpty) {

+ 1 - 3
packages/app/src/stores/page.tsx

@@ -17,9 +17,7 @@ import { useCurrentPageId } from './context';
 export const useSWRxPage = (pageId?: string|null, shareLinkId?: string): SWRResponse<IPagePopulatedToShowRevision, Error> => {
   return useSWR<IPagePopulatedToShowRevision, Error>(
     pageId != null ? ['/page', pageId, shareLinkId] : null,
-    (endpoint, pageId, shareLinkId) => apiv3Get<{ page: IPagePopulatedToShowRevision }>(
-      endpoint, { pageId, shareLinkId, includeEmpty: true },
-    ).then(result => result.data.page),
+    (endpoint, pageId, shareLinkId) => apiv3Get<{ page: IPagePopulatedToShowRevision }>(endpoint, { pageId, shareLinkId }).then(result => result.data.page),
   );
 };