Skip to content

Commit

Permalink
Improved: regex to remove duplicate / in some cases(#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Mar 18, 2024
1 parent 82acf5c commit ce2d6c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/views/InventoryReview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}])
Expand Down
2 changes: 1 addition & 1 deletion src/views/PurchaseOrderReview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}])
Expand Down

0 comments on commit ce2d6c9

Please sign in to comment.