Skip to content

Commit

Permalink
Improved: support to clear the search and selections when changing th…
Browse files Browse the repository at this point in the history
…e page(139)
  • Loading branch information
ymaheshwari1 committed Jul 10, 2023
1 parent ddba79f commit ed3e11a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,18 @@ const actions: ActionTree<OrderState, RootState> = {
commit(types.ORDER_COMPLETED_CLEARED)
},

async clearOpenOrders({ commit }) {
commit(types.ORDER_OPEN_CLEARED)
},

async clearInProgressOrders({ commit }) {
commit(types.ORDER_INPROGRESS_CLEARED)
},

async clearCompletedOrders({ commit }) {
commit(types.ORDER_COMPLETED_CLEARED)
},

async updateOpenQuery({ commit, dispatch }, payload) {
commit(types.ORDER_OPEN_QUERY_UPDATED, payload)
await dispatch('findOpenOrders');
Expand Down
1 change: 1 addition & 0 deletions src/views/Completed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export default defineComponent({
emitter.on('updateOrderQuery', this.updateOrderQuery)
},
unmounted() {
this.store.dispatch('order/clearCompletedOrders')
emitter.off('updateOrderQuery', this.updateOrderQuery)
},
methods: {
Expand Down
1 change: 1 addition & 0 deletions src/views/InProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ export default defineComponent({
emitter.on('updateOrderQuery', this.updateOrderQuery)
},
unmounted() {
this.store.dispatch('order/clearInProgressOrders')
emitter.off('updateOrderQuery', this.updateOrderQuery)
},
setup() {
Expand Down
1 change: 1 addition & 0 deletions src/views/OpenOrders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ export default defineComponent({
await Promise.all([this.initialiseOrderQuery(), this.fetchShipmentMethods()]);
},
unmounted() {
this.store.dispatch('order/clearOpenOrders');
emitter.off('updateOrderQuery', this.updateOrderQuery)
},
setup() {
Expand Down

0 comments on commit ed3e11a

Please sign in to comment.