Taichi Masuyama 4 лет назад
Родитель
Сommit
53710cb506

+ 0 - 4
packages/app/src/interfaces/page-listing-results.ts

@@ -1,9 +1,5 @@
 import { IPage } from './page';
 
-export interface ChildrenResult {
-  pages: Partial<IPage>[]
-}
-
 
 type ParentPath = string;
 export interface AncestorsChildrenResult {

+ 1 - 14
packages/app/src/stores/page-listing.tsx

@@ -1,7 +1,7 @@
 import useSWR, { SWRResponse } from 'swr';
 
 import { apiv3Get } from '../client/util/apiv3-client';
-import { ChildrenResult, TargetAndAncestorsResult, AncestorsChildrenResult } from '../interfaces/page-listing-results';
+import { TargetAndAncestorsResult, AncestorsChildrenResult } from '../interfaces/page-listing-results';
 
 
 export const useSWRxPageAncestorsChildren = (
@@ -31,16 +31,3 @@ export const useSWRxPageAncestors = (
   );
 };
 
-
-export const useSWRxPageChildren = (
-    path: string | null,
-): SWRResponse<ChildrenResult, Error> => {
-  return useSWR(
-    path ? `/page-listing/children?path=${path}` : null,
-    endpoint => apiv3Get(endpoint).then((response) => {
-      return {
-        pages: response.data.pages,
-      };
-    }),
-  );
-};