From fb36a2bf7d7131b7ab95f43d20bb7a85afddff83 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 4 Oct 2024 18:13:58 +0530 Subject: [PATCH] Improved: using pageSize while fetching product stores (#39) --- src/services/ProductStoreService.ts | 5 +++-- src/store/modules/productStore/actions.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/ProductStoreService.ts b/src/services/ProductStoreService.ts index a05be96..33e465a 100644 --- a/src/services/ProductStoreService.ts +++ b/src/services/ProductStoreService.ts @@ -24,10 +24,11 @@ const fetchProductStoreDetails = async (productStoreId: any): Promise => { }); } -const fetchProductStores = async (): Promise => { +const fetchProductStores = async (payload: any): Promise => { return api({ url: "productStores", - method: "get" + method: "get", + params: payload }); } diff --git a/src/store/modules/productStore/actions.ts b/src/store/modules/productStore/actions.ts index ae9cb0e..8fabab2 100644 --- a/src/store/modules/productStore/actions.ts +++ b/src/store/modules/productStore/actions.ts @@ -13,7 +13,7 @@ const actions: ActionTree = { let productStores = []; try { - const resp = await ProductStoreService.fetchProductStores(); + const resp = await ProductStoreService.fetchProductStores({ pageSize: 20 }); if(!hasError(resp)) { productStores = resp.data;