Explorar o código

80623 useSwr type

Mao %!s(int64=4) %!d(string=hai) anos
pai
achega
a4b1ce8c2e
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  1. 3 4
      packages/app/src/stores/page.tsx

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

@@ -35,12 +35,11 @@ export const useSWRxPageList = (
 };
 
 
-export const useSWRTagsInfo = (pageId: string) : SWRResponse<IPageTagsInfo, Error> => {
+export const useSWRTagsInfo = (pageId: string): SWRResponse<IPageTagsInfo, Error> => {
   // apiGet():Promise<unknown>
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
-  return useSWR(`/pages.getPageTag?pageId=${pageId}`, endpoint => apiGet(endpoint).then((response: any) => {
+  return useSWR(`/pages.getPageTag?pageId=${pageId}`, endpoint => apiGet(endpoint).then((response: IPageTagsInfo) => {
     return {
-      tags: response.data.tags,
+      tags: response.tags,
     };
   }));
 };