Yuki Takei 4 лет назад
Родитель
Сommit
c55419bd34
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/app/src/stores/comment.tsx

+ 2 - 2
packages/app/src/stores/comment.tsx

@@ -13,7 +13,7 @@ type IResponseComment = {
 export const useSWRxPageComment = (pageId: Nullable<string>): SWRResponse<ICommentHasIdList, Error> => {
   const shouldFetch: boolean = pageId != null;
   return useSWR(
-    shouldFetch ? '/comments.get' : null,
-    endpoint => apiGet(endpoint, { page_id: pageId }).then((response:IResponseComment) => response.comments),
+    shouldFetch ? ['/comments.get', pageId] : null,
+    (endpoint, pageId) => apiGet(endpoint, { page_id: pageId }).then((response:IResponseComment) => response.comments),
   );
 };