diff --git a/package-lock.json b/package-lock.json index 17e5c127..362e29ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", "@hotwax/dxp-components": "1.12.1", - "@hotwax/oms-api": "^1.10.0", + "@hotwax/oms-api": "^1.13.0", "@ionic/core": "6.7.5", "@ionic/vue": "6.7.5", "@ionic/vue-router": "6.7.5", @@ -2887,9 +2887,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 072a2ca4..69230ff9 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", "@hotwax/dxp-components": "1.12.1", - "@hotwax/oms-api": "^1.10.0", + "@hotwax/oms-api": "^1.13.0", "@ionic/core": "6.7.5", "@ionic/vue": "6.7.5", "@ionic/vue-router": "6.7.5", diff --git a/src/adapter/index.ts b/src/adapter/index.ts index 0fea6aab..387243bd 100644 --- a/src/adapter/index.ts +++ b/src/adapter/index.ts @@ -1,4 +1,4 @@ -import { api, client, getConfig, initialise, logout, resetConfig, updateInstanceUrl, updateToken } from '@hotwax/oms-api' +import { api, client, getConfig, initialise, logout, resetConfig, updateInstanceUrl, updateToken, setUserLocale } from '@hotwax/oms-api' export { api, @@ -8,5 +8,6 @@ export { logout, resetConfig, updateInstanceUrl, - updateToken + updateToken, + setUserLocale } \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index f799e2f2..4565a85f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -32,7 +32,7 @@ import { login, logout, loader } from './user-utils'; import permissionPlugin from '@/authorization'; import permissionRules from '@/authorization/Rules'; import permissionActions from '@/authorization/Actions'; -import { getConfig, initialise } from '@/adapter' +import { getConfig, initialise, setUserLocale} from '@/adapter' import localeMessages from './i18n/locales'; const app = createApp(App) @@ -54,7 +54,8 @@ const app = createApp(App) appLoginUrl: process.env.VUE_APP_LOGIN_URL as string, getConfig: getConfig, initialise: initialise, - localeMessages + localeMessages, + setUserLocale }); // Filters are removed in Vue 3 and global filter introduced https://v3.vuejs.org/guide/migration/filters.html#global-filters diff --git a/src/store/modules/user/getters.ts b/src/store/modules/user/getters.ts index a8455da8..c00ce56f 100644 --- a/src/store/modules/user/getters.ts +++ b/src/store/modules/user/getters.ts @@ -25,7 +25,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/`; }, getPwaState(state) { return state.pwaState;