Răsfoiți Sursa

improve returned value

kaori 4 ani în urmă
părinte
comite
c36d276923

+ 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),
   );
 };