Skip to content

Commit

Permalink
Improved: variable name for rejection method and added logic to clear…
Browse files Browse the repository at this point in the history
… the rejection reasons on logout(#283)
  • Loading branch information
ymaheshwari1 committed Oct 18, 2023
1 parent d60b33e commit 96d4dc5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/OrderItemRejHistoryModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions src/services/OrderService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const getShipmentItems = async (shipmentIds: any): Promise<any> => {
}, [])
}

const getOrderItemRejHistory = async (payload: any): Promise<any> => {
const getOrderItemRejectionHistory = async (payload: any): Promise<any> => {
return api({
url: 'performFind',
method: 'POST',
Expand All @@ -176,7 +176,7 @@ export const OrderService = {
getOrderDetails,
getCompletedOrders,
getPackedOrders,
getOrderItemRejHistory,
getOrderItemRejectionHistory,
quickShipEntireShipGroup,
rejectItem,
rejectOrderItem,
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ const actions: ActionTree<OrderState , RootState> ={
return resp;
},

async getOrderItemRejHistory({ commit }, payload) {
async getOrderItemRejectionHistory({ commit }, payload) {
emitter.emit("presentLoader");
let rejectionHistory = [] as any;

Expand All @@ -785,7 +785,7 @@ const actions: ActionTree<OrderState , RootState> ={
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;
Expand Down
1 change: 1 addition & 0 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const actions: ActionTree<UserState, RootState> = {
dispatch("product/clearProducts", null, { root: true })
dispatch('clearNotificationState')
dispatch('clearPartialOrderRejectionConfig');
this.dispatch('util/updateRejectReasons', [])
commit(types.USER_END_SESSION)
resetPermissions();
resetConfig();
Expand Down
6 changes: 5 additions & 1 deletion src/store/modules/util/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { hasError } from '@/adapter'

const actions: ActionTree<UtilState, RootState> = {
async fetchRejectReasons({ commit }) {
let rejectReasons = [];
let rejectReasons = [];
try {
const payload = {
"inputFields": {
Expand All @@ -32,6 +32,10 @@ const actions: ActionTree<UtilState, RootState> = {
}

commit(types.UTIL_REJECT_REASONS_UPDATED, rejectReasons)
},

async updateRejectReasons({ commit }, payload) {
commit(types.UTIL_REJECT_REASONS_UPDATED, payload)
}
}

Expand Down

0 comments on commit 96d4dc5

Please sign in to comment.