Shun Miyazawa 4 лет назад
Родитель
Сommit
59870fa5fa

+ 3 - 3
packages/app/src/components/Admin/UserGroupDetail/UserGroupDetailPage.tsx

@@ -43,7 +43,7 @@ const UserGroupDetailPage: FC = () => {
   /*
    * Fetch
    */
-  const { data: userGroupPages, mutate: mutateUserGroupPages } = useSWRxUserGroupPages(userGroup._id, 2, 2);
+  const { data: userGroupPages, mutate: mutateUserGroupPages } = useSWRxUserGroupPages(userGroup._id, 10, 0);
   const { data: userGroupRelations, mutate: mutateUserGroupRelations } = useSWRxUserGroupRelationList([userGroup._id]);
 
   /*
@@ -132,9 +132,9 @@ const UserGroupDetailPage: FC = () => {
       <UserGroupUserTable />
       <UserGroupUserModal />
       <h2 className="admin-setting-header mt-4">{t('Page')}</h2>
-      {/* <div className="page-list">
+      <div className="page-list">
         <UserGroupPageList />
-      </div> */}
+      </div>
     </div>
   );
 

+ 2 - 2
packages/app/src/stores/user-group.tsx

@@ -50,7 +50,7 @@ export const useSWRxUserGroupRelationList = (
 
 export const useSWRxUserGroupPages = (groupId: string | undefined, limit: number, offset: number): SWRResponse<IPageHasId[], Error> => {
   return useSWRImmutable(
-    groupId != null ? [`/user-groups/${groupId}/pages`, { limit, offset }] : null,
-    endpoint => apiv3Get<UserGroupPagesResult>(endpoint).then(result => result.data.userGroupPages),
+    groupId != null ? [`/user-groups/${groupId}/pages`, limit, offset] : null,
+    endpoint => apiv3Get<UserGroupPagesResult>(endpoint, { limit, offset }).then(result => result.data.pages),
   );
 };