소스 검색

include isEmpty into isNotFound

yuken 3 년 전
부모
커밋
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),
   );
 };