diff --git a/src/components/OrderItemRejHistoryModal.vue b/src/components/OrderItemRejHistoryModal.vue index 9c31157ef..80f640e67 100644 --- a/src/components/OrderItemRejHistoryModal.vue +++ b/src/components/OrderItemRejHistoryModal.vue @@ -86,7 +86,7 @@ export default defineComponent({ }) }, async mounted() { - await this.store.dispatch('order/getOrderItemRejHistory', { orderId: this.order.orderId, rejectReasonEnumIds: this.rejectReasons.reduce((enumIds: [], reason: any) => [...enumIds, reason.enumId], []) }); + await this.store.dispatch('order/getOrderItemRejectionHistory', { orderId: this.order.orderId, rejectReasonEnumIds: this.rejectReasons.reduce((enumIds: [], reason: any) => [...enumIds, reason.enumId], []) }); this.isLoading = false; }, methods: { diff --git a/src/services/OrderService.ts b/src/services/OrderService.ts index 3c2e5753b..d6589f240 100644 --- a/src/services/OrderService.ts +++ b/src/services/OrderService.ts @@ -163,7 +163,7 @@ const getShipmentItems = async (shipmentIds: any): Promise => { }, []) } -const getOrderItemRejHistory = async (payload: any): Promise => { +const getOrderItemRejectionHistory = async (payload: any): Promise => { return api({ url: 'performFind', method: 'POST', @@ -176,7 +176,7 @@ export const OrderService = { getOrderDetails, getCompletedOrders, getPackedOrders, - getOrderItemRejHistory, + getOrderItemRejectionHistory, quickShipEntireShipGroup, rejectItem, rejectOrderItem, diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 5afe26eee..09b763b6e 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -769,7 +769,7 @@ const actions: ActionTree ={ return resp; }, - async getOrderItemRejHistory({ commit }, payload) { + async getOrderItemRejectionHistory({ commit }, payload) { emitter.emit("presentLoader"); let rejectionHistory = [] as any; @@ -785,7 +785,7 @@ const actions: ActionTree ={ orderBy: 'changeDatetime DESC', viewSize: 20, } - const resp = await OrderService.getOrderItemRejHistory(params); + const resp = await OrderService.getOrderItemRejectionHistory(params); if (!hasError(resp) && resp.data.count > 0) { rejectionHistory = resp.data.docs; diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index f8567b25a..d9a2d669b 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -148,6 +148,7 @@ const actions: ActionTree = { dispatch("product/clearProducts", null, { root: true }) dispatch('clearNotificationState') dispatch('clearPartialOrderRejectionConfig'); + this.dispatch('util/updateRejectReasons', []) commit(types.USER_END_SESSION) resetPermissions(); resetConfig(); diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index 4cb226fe2..511963998 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -7,7 +7,7 @@ import { hasError } from '@/adapter' const actions: ActionTree = { async fetchRejectReasons({ commit }) { - let rejectReasons = []; + let rejectReasons = []; try { const payload = { "inputFields": { @@ -32,6 +32,10 @@ const actions: ActionTree = { } commit(types.UTIL_REJECT_REASONS_UPDATED, rejectReasons) + }, + + async updateRejectReasons({ commit }, payload) { + commit(types.UTIL_REJECT_REASONS_UPDATED, payload) } }