|
@@ -91,12 +91,15 @@ export const useSWRxPageInfo = (
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-export const useSWRxPageInfoForList = (pageIds: string[] | null | undefined): SWRResponse<Record<string, IPageInfo | IPageInfoForListing>, Error> => {
|
|
|
|
|
|
|
+export const useSWRxPageInfoForList = (
|
|
|
|
|
+ pageIds: string[] | null | undefined,
|
|
|
|
|
+ includeShortBody = false,
|
|
|
|
|
+): SWRResponse<Record<string, IPageInfo | IPageInfoForListing>, Error> => {
|
|
|
|
|
|
|
|
const shouldFetch = pageIds != null && pageIds.length > 0;
|
|
const shouldFetch = pageIds != null && pageIds.length > 0;
|
|
|
|
|
|
|
|
return useSWRImmutable(
|
|
return useSWRImmutable(
|
|
|
- shouldFetch ? ['/page-listing/info', pageIds] : null,
|
|
|
|
|
- (endpoint, pageIds) => apiv3Get(endpoint, { pageIds }).then(response => response.data),
|
|
|
|
|
|
|
+ shouldFetch ? ['/page-listing/info', pageIds, includeShortBody] : null,
|
|
|
|
|
+ (endpoint, pageIds, includeShortBody) => apiv3Get(endpoint, { pageIds, includeShortBody }).then(response => response.data),
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|