From 87adbf8547b307f77e14572ed99523fdedff6ac7 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Thu, 18 Dec 2025 13:31:08 +0700 Subject: [PATCH] refactor(FE-363): Accept array filters in logistic purchase report --- src/services/api/report/logistic-stock.ts | 25 +++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/services/api/report/logistic-stock.ts b/src/services/api/report/logistic-stock.ts index 753e0aaf..e09f8bde 100644 --- a/src/services/api/report/logistic-stock.ts +++ b/src/services/api/report/logistic-stock.ts @@ -12,10 +12,10 @@ export class LogisticApiService extends BaseApiService< } async getLogisticPurchasePerSupplierReport( - area_id?: string, - supplier_id?: string, - product_id?: string, - product_category_id?: string, + area_id?: string[], + supplier_id?: string[], + product_id?: string[], + product_category_id?: string[], received_date?: string, po_date?: string, start_date?: string, @@ -30,10 +30,19 @@ export class LogisticApiService extends BaseApiService< >(`purchase-supplier`, { method: 'GET', params: { - area_id: area_id, - supplier_id: supplier_id, - product_id: product_id, - product_category_id: product_category_id, + area_id: area_id && area_id.length > 0 ? area_id.join(',') : undefined, + supplier_id: + supplier_id && supplier_id.length > 0 + ? supplier_id.join(',') + : undefined, + product_id: + product_id && product_id.length > 0 + ? product_id.join(',') + : undefined, + product_category_id: + product_category_id && product_category_id.length > 0 + ? product_category_id.join(',') + : undefined, received_date: received_date, po_date: po_date, start_date: start_date,