Skip to content

Commit

Permalink
Merge pull request #137 from ymaheshwari1/#135
Browse files Browse the repository at this point in the history
Fixed: run not displayed after creation immediately(#135)
  • Loading branch information
ymaheshwari1 authored Mar 27, 2024
2 parents 50363ee + d2af84a commit fa66e04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/store/modules/orderRouting/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ const actions: ActionTree<OrderRoutingState, RootState> = {
async createRoutingGroup({ dispatch }, groupName) {
const payload = {
groupName,
productStoreId: "STORE",
productStoreId: store.state.user.currentEComStore.productStoreId,
createdDate: DateTime.now().toMillis()
}
try {
const resp = await OrderRoutingService.createRoutingGroup(payload)

if(!hasError(resp)) {
showToast(translate("Brokering run created"))
dispatch("fetchOrderRoutingGroups")
await dispatch("fetchOrderRoutingGroups")
} else {
throw resp.data
}
Expand Down
5 changes: 3 additions & 2 deletions src/views/BrokeringRuns.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,15 @@ async function addNewRun() {
}]
})
newRunAlert.onDidDismiss().then((result: any) => {
newRunAlert.onDidDismiss().then(async (result: any) => {
// considering that if we have role, then its negative action and thus not need to create run
if(result.role) {
return;
}
if(result.data?.values?.runName.trim()) {
store.dispatch("orderRouting/createRoutingGroup", result.data.values.runName.trim())
await store.dispatch("orderRouting/createRoutingGroup", result.data.values.runName.trim())
brokeringGroups.value = JSON.parse(JSON.stringify(groups.value))
}
})
Expand Down

0 comments on commit fa66e04

Please sign in to comment.