From ce2d6c96b5afca65aa552920f5161b69e84d7f87 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Mon, 18 Mar 2024 15:36:54 +0530 Subject: [PATCH] Improved: regex to remove duplicate / in some cases(#268) --- src/views/InventoryReview.vue | 2 +- src/views/PurchaseOrderReview.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/InventoryReview.vue b/src/views/InventoryReview.vue index 41e75281..f411e8d3 100644 --- a/src/views/InventoryReview.vue +++ b/src/views/InventoryReview.vue @@ -258,7 +258,7 @@ export default defineComponent({ text: translate('View'), role: 'view', handler: () => { - const omsURL = (this.instanceUrl.startsWith('http') ? this.instanceUrl.replace(/api\/?/, "") : `https://${this.instanceUrl}.hotwax.io`) + `/commerce/control/ImportData?configId=RESET_INVENTORY` + 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'); } }]) diff --git a/src/views/PurchaseOrderReview.vue b/src/views/PurchaseOrderReview.vue index 394f4a6a..cfb789c8 100644 --- a/src/views/PurchaseOrderReview.vue +++ b/src/views/PurchaseOrderReview.vue @@ -283,7 +283,7 @@ export default defineComponent({ text: translate('View'), role: 'view', handler: () => { - const omsURL = (this.instanceUrl.startsWith('http') ? this.instanceUrl.replace(/api\/?/, "") : `https://${this.instanceUrl}.hotwax.io`) + `/commerce/control/ImportData?configId=IMP_PO` + 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'); } }])