Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved: pageSize filter while fetching records for avoiding missing records issue #36

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading