From 199b1d2d3dde9fe68e2d69895cd318804afe76a9 Mon Sep 17 00:00:00 2001 From: Sourabh Raghuwanshi Date: Thu, 14 Mar 2024 11:07:25 +0530 Subject: [PATCH] Improved:Update oms-api package to latest release(#272) --- package-lock.json | 8 ++++---- package.json | 2 +- src/services/UserService.ts | 3 +-- src/store/modules/user/getters.ts | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa10ac6..f34107b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", "@hotwax/dxp-components": "^1.12.0", - "@hotwax/oms-api": "^1.10.0", + "@hotwax/oms-api": "^1.13.0", "@ionic/core": "~7.6.0", "@ionic/vue": "~7.6.0", "@ionic/vue-router": "~7.6.0", @@ -2831,9 +2831,9 @@ } }, "node_modules/@hotwax/oms-api": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@hotwax/oms-api/-/oms-api-1.11.0.tgz", - "integrity": "sha512-HQCXuADMVkQXAS9ClWFrTYNjSFP8wQuGMILEkLDh9R2YR1gNnJ4GezeZuxXQOjhxBg7zXxbdL3v5/q03P32O5g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@hotwax/oms-api/-/oms-api-1.13.0.tgz", + "integrity": "sha512-D7bdS1XBfEu9fT23+mViC4FbyhFfg9GN95Epp/5V85Xcl8udxqOjHI9xcRMxANgrMjPNksshT1rm7F/TfEi/+g==", "dependencies": { "@types/node-json-transform": "^1.0.0", "axios": "^0.21.1", diff --git a/package.json b/package.json index 325c91e..18ba51e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", "@hotwax/dxp-components": "^1.12.0", - "@hotwax/oms-api": "^1.10.0", + "@hotwax/oms-api": "^1.13.0", "@ionic/core": "~7.6.0", "@ionic/vue": "~7.6.0", "@ionic/vue-router": "~7.6.0", diff --git a/src/services/UserService.ts b/src/services/UserService.ts index 3bf53c6..25c150d 100644 --- a/src/services/UserService.ts +++ b/src/services/UserService.ts @@ -14,8 +14,7 @@ const login = async (username: string, password: string): Promise => { } const checkPermission = async (payload: any): Promise => { - let baseURL = store.getters['user/getInstanceUrl']; - baseURL = baseURL && baseURL.startsWith('http') ? baseURL : `https://${baseURL}.hotwax.io/api/`; + const baseURL = store.getters['user/getBaseUrl']; return client({ url: "checkPermission", method: "post", diff --git a/src/store/modules/user/getters.ts b/src/store/modules/user/getters.ts index 8b79af3..c93c68b 100644 --- a/src/store/modules/user/getters.ts +++ b/src/store/modules/user/getters.ts @@ -31,7 +31,7 @@ const getters: GetterTree = { getBaseUrl(state) { let baseURL = process.env.VUE_APP_BASE_URL; if (!baseURL) baseURL = state.instanceUrl; - return baseURL.startsWith('http') ? baseURL : `https://${baseURL}.hotwax.io/api/`; + return baseURL.startsWith('http') ? baseURL.includes('/api') ? baseURL : `${baseURL}/api/` : `https://${baseURL}.hotwax.io/api/`; }, } export default getters; \ No newline at end of file