orderiom-api-package 0.3.35 → 0.3.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orderiom-api-package",
3
- "version": "0.3.35",
3
+ "version": "0.3.36",
4
4
  "description": "This package will install all necessary API calls for every orderiom restaurant",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/common.js CHANGED
@@ -2,7 +2,7 @@ import axios from "axios";
2
2
 
3
3
  export const restaurantIdEnv = process.env.VUE_APP_RESTAURANT_ID
4
4
  ? parseInt(process.env.VUE_APP_RESTAURANT_ID)
5
- : window.dynamicData.VUE_APP_RESTAURANT_ID
5
+ : window.dynamicData && window.dynamicData.VUE_APP_RESTAURANT_ID
6
6
  ? parseInt(window.dynamicData.VUE_APP_RESTAURANT_ID)
7
7
  : null;
8
8
 
@@ -78,7 +78,7 @@ export function updateBasket({commit, basketId, res, restaurantId}){
78
78
  return true;
79
79
  }
80
80
 
81
- axios.defaults.baseURL = window.dynamicData.VUE_APP_BASE_API_URL || process.env.VUE_APP_BASE_API_URL;
81
+ axios.defaults.baseURL = process.env.VUE_APP_BASE_API_URL || window.dynamicData.VUE_APP_BASE_API_URL;
82
82
  axios.interceptors.request.use(config => {
83
83
  const token = localStorage.getItem("privateToken") || localStorage.getItem("publicToken");
84
84
  if (token) config.headers["Authorization"] = `Bearer ${token}`;
@@ -55,9 +55,9 @@ const actions = {
55
55
  auth({ commit }) {
56
56
  return $http
57
57
  .post("api/oauth/token", {
58
- grant_type: window.dynamicData.VUE_APP_GRANT_TYPE || process.env.VUE_APP_GRANT_TYPE,
59
- client_id: window.dynamicData.VUE_APP_CLIENT_ID || process.env.VUE_APP_CLIENT_ID,
60
- client_secret: window.dynamicData.VUE_APP_CLIENT_SECRET || process.env.VUE_APP_CLIENT_SECRET
58
+ grant_type: process.env.VUE_APP_GRANT_TYPE || window.dynamicData.VUE_APP_GRANT_TYPE,
59
+ client_id: process.env.VUE_APP_CLIENT_ID || window.dynamicData.VUE_APP_CLIENT_ID,
60
+ client_secret: process.env.VUE_APP_CLIENT_SECRET || window.dynamicData.VUE_APP_CLIENT_SECRET
61
61
  })
62
62
  .then(res => {
63
63
  commit('setPublicToken', res.data.data.access_token)