Procházet zdrojové kódy

change the swr key to an array and pass params

kaori před 4 roky
rodič
revize
11d5c5ab31
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      packages/app/src/stores/in-app-notification.ts

+ 2 - 2
packages/app/src/stores/in-app-notification.ts

@@ -11,7 +11,7 @@ export const useSWRxInAppNotifications = <Data, Error>(
   offset?: number,
 ): SWRResponse<PaginateResult<IInAppNotification>, Error> => {
   return useSWR(
-    `/in-app-notification/list?limit=${limit}&offset=${offset}`,
-    endpoint => apiv3Get(endpoint).then(response => response.data),
+    ['/in-app-notification/list', limit, offset],
+    endpoint => apiv3Get(endpoint, { limit, offset }).then(response => response.data),
   );
 };