From 82acf5c54310ebb5d8eca9c85b6e229d213efa6b Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Mon, 18 Mar 2024 14:35:15 +0530 Subject: [PATCH] Fixed: issue when redirecting to commerce after successfull upload of inventory or PO file(#268) --- src/views/InventoryReview.vue | 3 ++- src/views/PurchaseOrderReview.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/InventoryReview.vue b/src/views/InventoryReview.vue index 9274420b..41e75281 100644 --- a/src/views/InventoryReview.vue +++ b/src/views/InventoryReview.vue @@ -258,7 +258,8 @@ export default defineComponent({ text: translate('View'), role: 'view', handler: () => { - window.open(`https://${this.instanceUrl}.hotwax.io/commerce/control/ImportData?configId=RESET_INVENTORY`, '_blank'); + const omsURL = (this.instanceUrl.startsWith('http') ? this.instanceUrl.replace(/api\/?/, "") : `https://${this.instanceUrl}.hotwax.io`) + `/commerce/control/ImportData?configId=RESET_INVENTORY` + window.open(omsURL, '_blank'); } }]) this.router.push("/inventory"); diff --git a/src/views/PurchaseOrderReview.vue b/src/views/PurchaseOrderReview.vue index fee6e4aa..394f4a6a 100644 --- a/src/views/PurchaseOrderReview.vue +++ b/src/views/PurchaseOrderReview.vue @@ -283,7 +283,8 @@ export default defineComponent({ text: translate('View'), role: 'view', handler: () => { - window.open(`https://${this.instanceUrl}.hotwax.io/commerce/control/ImportData?configId=IMP_PO`, '_blank'); + const omsURL = (this.instanceUrl.startsWith('http') ? this.instanceUrl.replace(/api\/?/, "") : `https://${this.instanceUrl}.hotwax.io`) + `/commerce/control/ImportData?configId=IMP_PO` + window.open(omsURL, '_blank'); } }]) this.router.push("/purchase-order");