diff --git a/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx b/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx index 6b641358..9e3deb95 100644 --- a/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx +++ b/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx @@ -15,7 +15,7 @@ import Table from '@/components/Table'; import { ColumnDef } from '@tanstack/react-table'; import { formatCurrency, formatDate } from '@/lib/helper'; import { - SupplierWithItems, + LogisticPurchasePerSupplier, LogisticPurchasePerSupplierItems, } from '@/types/api/report/logistic-stock'; import { isResponseSuccess } from '@/lib/api-helper'; @@ -149,8 +149,8 @@ const PurchasesPerSupplierTab = () => { LogisticService.getAllFetcher ); - const data: SupplierWithItems[] = isResponseSuccess(response) - ? (response?.data as unknown as SupplierWithItems[]) + const data: LogisticPurchasePerSupplier[] = isResponseSuccess(response) + ? (response?.data as unknown as LogisticPurchasePerSupplier[]) : []; const getTableColumns = ( diff --git a/src/types/api/report/logistic-stock.d.ts b/src/types/api/report/logistic-stock.d.ts index a275898e..2f771bfa 100644 --- a/src/types/api/report/logistic-stock.d.ts +++ b/src/types/api/report/logistic-stock.d.ts @@ -20,12 +20,12 @@ export type LogisticPurchasePerSupplierItems = { travel_number: string; }; -export type SupplierWithItems = { +export type LogisticPurchasePerSupplier = { id: number; supplier: Supplier; items: LogisticPurchasePerSupplierItems[]; }; export type LogisticPurchasePerSupplierReport = BaseMetadata & { - data: SupplierWithItems[]; + data: LogisticPurchasePerSupplier[]; };