Skip to content

Commit

Permalink
Improved: pageSize filter while fetching records for avoiding missing…
Browse files Browse the repository at this point in the history
… records issue
  • Loading branch information
amansinghbais committed Aug 8, 2024
1 parent 97aa7b8 commit 37381e0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/services/ProductStoreService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@ const fetchProductStoreDetails = async (productStoreId: any): Promise <any> => {
});
}

const fetchProductStores = async (): Promise <any> => {
const fetchProductStores = async (payload: any): Promise <any> => {
return api({
url: "productStores",
method: "get"
method: "get",
params: payload
});
}

const fetchProductStoresFacilityCount = async (): Promise <any> => {
const fetchProductStoresFacilityCount = async (payload: any): Promise <any> => {
return api({
url: "productStores/facilities/counts",
method: "get"
method: "get",
params: payload
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/productStore/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const actions: ActionTree<ProductStoreState, RootState> = {
let productStores = [];

try {
const resp = await ProductStoreService.fetchProductStores();
const resp = await ProductStoreService.fetchProductStores({ pageSize: 100 });

if(!hasError(resp)) {
productStores = resp.data;
Expand Down Expand Up @@ -52,7 +52,7 @@ const actions: ActionTree<ProductStoreState, RootState> = {
const productStoresFacilityCount = {} as any;

try {
const resp = await ProductStoreService.fetchProductStoresFacilityCount();
const resp = await ProductStoreService.fetchProductStoresFacilityCount({ pageSize: 100 });

if(!hasError(resp)) {
resp.data.map((response: any) => productStoresFacilityCount[response.productStoreId] = response.facilityCount)
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/util/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const actions: ActionTree<UtilState, RootState> = {
let productIdentifiers = [] as any;

try {
const resp = await UtilService.fetchEnums({ enumTypeId: "SHOP_PROD_IDENTITY" })
const resp = await UtilService.fetchEnums({ enumTypeId: "SHOP_PROD_IDENTITY", pageSize: 100 })
if(!hasError(resp)) {
productIdentifiers = resp.data;
} else {
Expand Down

0 comments on commit 37381e0

Please sign in to comment.