소스 검색

improve returned value

kaori 4 년 전
부모
커밋
c36d276923
2개의 변경된 파일2개의 추가작업 그리고 9개의 파일을 삭제
  1. 1 2
      packages/app/src/components/InAppNotification/AllInAppNotifications.tsx
  2. 1 7
      packages/app/src/stores/in-app-notification.ts

+ 1 - 2
packages/app/src/components/InAppNotification/AllInAppNotifications.tsx

@@ -51,9 +51,8 @@ const AllInAppNotifications: FC<Props> = (props: Props) => {
       </div>
     );
   }
-  const notifications = inAppNotificationdata.data.docs;
-  console.log('notifications!!', notifications);
 
+  const notifications = inAppNotificationdata.docs;
   return (
     <InAppNotificationList notifications={notifications} isLoaded={isLoaded} />
   );

+ 1 - 7
packages/app/src/stores/in-app-notification.ts

@@ -11,12 +11,6 @@ export const useSWRxInAppNotifications = <Data, Error>(
   return useSWR(
     '/in-app-notification/list',
     // endpoint => apiv3Get<{ notifications: IInAppNotification[], limit: number }>(endpoint).then(response => response.data?.notifications),
-    endpoint => apiv3Get(endpoint, { limit }).then((response) => {
-      console.log('responsehoges', response.data);
-
-      return {
-        data: response.data,
-      };
-    }),
+    endpoint => apiv3Get(endpoint, { limit }).then(response => response.data),
   );
 };