Shun Miyazawa 4 년 전
부모
커밋
e2f922bed2
3개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 1
      packages/app/src/components/Admin/AuditLog.tsx
  2. 1 1
      packages/app/src/server/routes/apiv3/activity.ts
  3. 1 1
      packages/app/src/stores/activity.ts

+ 3 - 1
packages/app/src/components/Admin/AuditLog.tsx

@@ -6,7 +6,9 @@ const AuditLog: FC = () => {
   const { data: activityListData } = useSWRxActivityList(5, 0);
 
   // eslint-disable-next-line @typescript-eslint/no-unused-vars
-  const activityList = activityListData != null ? activityListData : null;
+  const activityList = activityListData?.docs != null ? activityListData.docs : [];
+
+  console.log(activityList);
 
   return (
     <>Hello, AuditLog</>

+ 1 - 1
packages/app/src/server/routes/apiv3/activity.ts

@@ -24,7 +24,7 @@ const apiLimiter = rateLimit({
   windowMs: 15 * 60 * 1000, // 15 minutes
   max: 10, // limit each IP to 10 requests per windowMs
   message:
-    'Too many requests were sent from this IP. Please try a password reset request again on the password reset request form',
+    'Too many requests sent from this IP, please try again after 15 minutes.',
 });
 
 module.exports = (crowi: Crowi): Router => {

+ 1 - 1
packages/app/src/stores/activity.ts

@@ -7,7 +7,7 @@ import { PaginateResult } from '../interfaces/mongoose-utils';
 
 export const useSWRxActivityList = (limit?: number, offset?: number): SWRResponse<PaginateResult<IActivity>, Error> => {
   return useSWRImmutable(
-    ['/activity/list', limit, offset],
+    ['/activity', limit, offset],
     (endpoint, limit, offset) => apiv3Get(endpoint, { limit, offset }).then(result => result.data.paginatedActivity),
   );
 };