Skip to content

Commit

Permalink
Improved: set multivalued to always 'Y' and fetching ruleGroup with a…
Browse files Browse the repository at this point in the history
…ctive status (hotwax#299)
  • Loading branch information
amansinghbais committed May 8, 2024
1 parent 46c4895 commit a9b94cf
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/SelectConfigFacilitiesModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function saveFacilities() {
"fieldName": "facilities",
"operator": "in",
"fieldValue": selectedFacilityValues.length > 1 ? selectedFacilityValues.join(",") : selectedFacilityValues[0],
"multiValued": selectedFacilityValues.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/UpdateFacilityGroupModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async function saveFacilityGroups() {
"fieldName": "facilityGroups",
"operator": "in",
"fieldValue": includedGroups.value?.length > 1 ? includedGroups.value.join(",") : includedGroups.value[0],
"multiValued": includedGroups.value?.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand All @@ -144,7 +144,7 @@ async function saveFacilityGroups() {
"fieldName": "facilityGroups",
"operator": "not-in",
"fieldValue": excludedGroups.value?.length > 1 ? excludedGroups.value.join(",") : excludedGroups.value[0],
"multiValued": excludedGroups.value?.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/UpdateProductFiltersModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async function saveFilters() {
"fieldName": props.searchfield,
"operator": "in",
"fieldValue": includedFilters.value?.length > 1 ? includedFilters.value.join(",") : includedFilters.value[0],
"multiValued": includedFilters.value?.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand All @@ -192,7 +192,7 @@ async function saveFilters() {
"fieldName": props.searchfield,
"operator": "not-in",
"fieldValue": excludedFilters.value?.length > 1 ? excludedFilters.value.join(",") : excludedFilters.value[0],
"multiValued": excludedFilters.value?.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/rule/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const actions: ActionTree<RuleState, RootState> = {
let resp;

try {
resp = await RuleService.fetchRuleGroup({ ...payload, productStoreId: productStore.productStoreId })
resp = await RuleService.fetchRuleGroup({ ...payload, productStoreId: productStore.productStoreId, statusId: "ATP_RG_ACTIVE" })

if(!hasError(resp) && resp.data.length) {
ruleGroup = resp.data[0]
Expand Down
6 changes: 3 additions & 3 deletions src/views/CreateSafetyStockRule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": "facilities",
"operator": "in",
"fieldValue": includedFacilityGroupIds.length > 1 ? includedFacilityGroupIds.join(",") : includedFacilityGroupIds[0],
"multiValued": includedFacilityGroupIds.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand All @@ -165,7 +165,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": "facilities",
"operator": "not-in",
"fieldValue": excludedFacilityGroupIds.length > 1 ? excludedFacilityGroupIds.join(",") : excludedFacilityGroupIds[0],
"multiValued": excludedFacilityGroupIds.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand All @@ -178,7 +178,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": filter,
"operator": type === "included" ? "in" : "not-in",
"fieldValue": value.length > 1 ? value.join(",") : value[0],
"multiValued": value.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
})
Expand Down
8 changes: 4 additions & 4 deletions src/views/CreateShippingRule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": "facilityGroups",
"operator": "in",
"fieldValue": includedFacilityGroupIds.length > 1 ? includedFacilityGroupIds.join(",") : includedFacilityGroupIds[0],
"multiValued": includedFacilityGroupIds.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand All @@ -259,7 +259,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": "facilityGroups",
"operator": "not-in",
"fieldValue": excludedFacilityGroupIds.length > 1 ? excludedFacilityGroupIds.join(",") : excludedFacilityGroupIds[0],
"multiValued": excludedFacilityGroupIds.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
} else {
Expand All @@ -271,7 +271,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": "facilities",
"operator": "in",
"fieldValue": selectedFacilites.length > 1 ? selectedFacilites.join(",") : selectedFacilites[0],
"multiValued": selectedFacilites.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
}
Expand All @@ -285,7 +285,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": filter,
"operator": type === "included" ? "in" : "not-in",
"fieldValue": value.length > 1 ? value.join(",") : value[0],
"multiValued": value.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
})
Expand Down
8 changes: 4 additions & 4 deletions src/views/CreateStorePickupRule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": "facilities",
"operator": "in",
"fieldValue": includedFacilityGroupIds.length > 1 ? includedFacilityGroupIds.join(",") : includedFacilityGroupIds[0],
"multiValued": includedFacilityGroupIds.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand All @@ -259,7 +259,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": "facilities",
"operator": "not-in",
"fieldValue": excludedFacilityGroupIds.length > 1 ? excludedFacilityGroupIds.join(",") : excludedFacilityGroupIds[0],
"multiValued": excludedFacilityGroupIds.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
} else {
Expand All @@ -271,7 +271,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": "facilities",
"operator": "in",
"fieldValue": selectedFacilites.length > 1 ? selectedFacilites.join(",") : selectedFacilites[0],
"multiValued": selectedFacilites.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
}
Expand All @@ -285,7 +285,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": filter,
"operator": type === "included" ? "in" : "not-in",
"fieldValue": value.length > 1 ? value.join(",") : value[0],
"multiValued": value.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
})
Expand Down
4 changes: 2 additions & 2 deletions src/views/CreateThresholdRule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": "facilities",
"operator": "in",
"fieldValue": selectedFacilites.length > 1 ? selectedFacilites.join(",") : selectedFacilites[0],
"multiValued": selectedFacilites.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
Expand All @@ -154,7 +154,7 @@ function generateRuleConditions(ruleId: string) {
"fieldName": filter,
"operator": type === "included" ? "in" : "not-in",
"fieldValue": value.length > 1 ? value.join(",") : value[0],
"multiValued": value.length > 1 ? "Y" : "N"
"multiValued": "Y"
})
}
})
Expand Down

0 comments on commit a9b94cf

Please sign in to comment.