diff --git a/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx b/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx index fd6b67d5..d74ec53f 100644 --- a/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx +++ b/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx @@ -157,13 +157,15 @@ const PurchasesPerSupplierTab = () => { }, [updateFilter]); // ===== DATA FETCHING ===== - const { data: response, isLoading } = useSWR( + const { data: purchasePerSupplier, isLoading } = useSWR( `${LogisticService.basePath}/purchase-supplier${getTableFilterQueryString()}`, LogisticService.getAllFetcher ); - const data: LogisticPurchasePerSupplier[] = isResponseSuccess(response) - ? (response?.data as unknown as LogisticPurchasePerSupplier[]) + const data: LogisticPurchasePerSupplier[] = isResponseSuccess( + purchasePerSupplier + ) + ? (purchasePerSupplier?.data as unknown as LogisticPurchasePerSupplier[]) : []; const getTableColumns = (