Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved: showing loader when updating carrier and updting the shipment methods in the detail page when carrier updated from tracking modal (#801) #900

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/views/OrderDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ export default defineComponent({
async updateCarrierAndShippingMethod(carrierPartyId: string, shipmentMethodTypeId: string) {
let resp;
try {
emitter.emit("presentLoader");
this.isUpdatingCarrierDetail = true;
const carrierShipmentMethods = await this.getProductStoreShipmentMethods(carrierPartyId);
shipmentMethodTypeId = shipmentMethodTypeId ? shipmentMethodTypeId : carrierShipmentMethods?.[0]?.shipmentMethodTypeId;
Expand Down Expand Up @@ -620,6 +621,7 @@ export default defineComponent({
}

this.shipmentMethodTypeId = shipmentMethodTypeId
emitter.emit("dismissLoader");
showToast(translate("Shipment method detail updated successfully."))
//fetching updated shipment packages
await this.store.dispatch('order/updateShipmentPackageDetail', this.order)
Expand All @@ -637,13 +639,15 @@ export default defineComponent({
this.carrierPartyId = this.order.shipmentPackages?.[0].carrierPartyId;
this.shipmentMethodTypeId = this.order.shipmentPackages?.[0].shipmentMethodTypeId;

emitter.emit("dismissLoader");
logger.error('Failed to update carrier and method', err);
showToast(translate("Failed to update shipment method detail."));
}
},
updateCarrierShipmentDetails(carrierPartyId: string, shipmentMethodTypeId: string) {
async updateCarrierShipmentDetails(carrierPartyId: string, shipmentMethodTypeId: string) {
this.carrierPartyId = carrierPartyId
this.shipmentMethodTypeId = shipmentMethodTypeId
this.carrierMethods = await this.getProductStoreShipmentMethods(carrierPartyId);
this.shipmentLabelErrorMessages = ""
},
async fetchKitComponent(orderItem: any, isOtherShipment = false ) {
Expand Down
Loading