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

Fixed: issue in filters not being fetched by passing pageSize param #229

Merged
merged 2 commits into from
Jun 14, 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
5 changes: 3 additions & 2 deletions src/store/modules/orderRouting/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
let routingGroups = [] as any;
// filter groups on the basis of productStoreId
const payload = {
productStoreId: store.state.user.currentEComStore.productStoreId
productStoreId: store.state.user.currentEComStore.productStoreId,
pageSize: 200
}

try {
Expand Down Expand Up @@ -216,7 +217,7 @@
let routingHistory = {}

try {
const resp = await OrderRoutingService.fetchRoutingHistory(routingGroupId, { orderByField: "startDate DESC" })
const resp = await OrderRoutingService.fetchRoutingHistory(routingGroupId, { orderByField: "startDate DESC", pageSize: 500 })

if(!hasError(resp)) {
// Sorting the history based on startTime, as we does not get the records in sorted order from api
Expand All @@ -243,7 +244,7 @@
commit(types.ORDER_ROUTING_HISTORY_UPDATED, routingHistory)
},

async deleteRoutingFilters({ dispatch }, payload) {

Check warning on line 247 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 247 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
let hasAllFiltersDeletedSuccessfully = true;
try {
// As discussed, we can't make parallel api calls, hence using for loop to make api calls
Expand All @@ -263,7 +264,7 @@
return hasAllFiltersDeletedSuccessfully
},

async updateRouting({ dispatch }, payload) {

Check warning on line 267 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 267 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
let orderRoutingId = ''
try {
const resp = await OrderRoutingService.updateRouting(payload)
Expand Down Expand Up @@ -314,7 +315,7 @@
return routingRuleId;
},

async deleteRuleConditions({ dispatch }, payload) {

Check warning on line 318 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 318 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
// TODO: check if we can call request in parallel for delete operation
let hasAllConditionsDeletedSuccessfully = true;
try {
Expand All @@ -334,7 +335,7 @@
return hasAllConditionsDeletedSuccessfully
},

async deleteRuleActions({ dispatch }, payload) {

Check warning on line 338 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 338 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
// TODO: check if we can call request in parallel for delete operation
let hasAllActionsDeletedSuccessfully = true;
try {
Expand Down Expand Up @@ -397,7 +398,7 @@
return rulesInformation[routingRuleId] ? JSON.parse(JSON.stringify(rulesInformation[routingRuleId])) : {}
},

async updateRule({ dispatch }, payload) {

Check warning on line 401 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 401 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
let routingRuleId = ''
try {
const resp = await OrderRoutingService.updateRule(payload)
Expand Down
14 changes: 10 additions & 4 deletions src/store/modules/util/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ const actions: ActionTree<UtilState, RootState> = {
}

try {
const resp = await UtilService.fetchEnums(payload);
const resp = await UtilService.fetchEnums({
...payload,
pageSize: 500
});

if(!hasError(resp) && resp.data.length) {
enums = resp.data.reduce((enumerations: any, data: EnumerationAndType) => {
Expand Down Expand Up @@ -45,7 +48,8 @@ const actions: ActionTree<UtilState, RootState> = {
}

const payload = {
parentTypeId: "VIRTUAL_FACILITY"
parentTypeId: "VIRTUAL_FACILITY",
pageSize: 200
}

try {
Expand Down Expand Up @@ -74,7 +78,8 @@ const actions: ActionTree<UtilState, RootState> = {

// Fetching shipping methods for productStore of the currentGroup
const payload = {
productStoreId: store.state.orderRouting.currentGroup.productStoreId
productStoreId: store.state.orderRouting.currentGroup.productStoreId,
pageSize: 200
}

try {
Expand Down Expand Up @@ -102,7 +107,8 @@ const actions: ActionTree<UtilState, RootState> = {
}

const payload = {
productStoreId: store.state.orderRouting.currentGroup.productStoreId
productStoreId: store.state.orderRouting.currentGroup.productStoreId,
pageSize: 200
}

try {
Expand Down
Loading