orderiom-api-package 0.4.28 → 0.4.30

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.4.28",
3
+ "version": "0.4.30",
4
4
  "description": "This package will install all necessary API calls for every orderiom restaurant",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/src/common.js CHANGED
@@ -2,11 +2,13 @@ import axios from "axios";
2
2
 
3
3
  export const weekdays = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
4
4
 
5
- export const restaurantIdEnv = () => process.env.VUE_APP_RESTAURANT_ID
6
- ? parseInt(process.env.VUE_APP_RESTAURANT_ID)
7
- : window.dynamicData && window.dynamicData.VUE_APP_RESTAURANT_ID
8
- ? parseInt(window.dynamicData.VUE_APP_RESTAURANT_ID)
9
- : null;
5
+ export const restaurantIdEnv = () => {
6
+ return process.env.VUE_APP_RESTAURANT_ID
7
+ ? parseInt(process.env.VUE_APP_RESTAURANT_ID)
8
+ : window.dynamicData && window.dynamicData.VUE_APP_RESTAURANT_ID
9
+ ? parseInt(window.dynamicData.VUE_APP_RESTAURANT_ID)
10
+ : null;
11
+ }
10
12
 
11
13
  export function commonErrorCallback(unknownErrorMessage = 'Something went wrong'){
12
14
  return error => {
@@ -74,7 +74,7 @@ const actions = {
74
74
  delete data.ordermood
75
75
  }
76
76
  return $http
77
- .post(`api/auth/login`, null, { params: data })
77
+ .post(`api/auth/login`, data)
78
78
  .then(res => {
79
79
  if (authData.manager) {
80
80
  window.localStorage.setItem("managerToken", res.data.data.access_token);
@@ -201,7 +201,7 @@ const actions = {
201
201
  const basketId = foundBasket ? foundBasket.basketId : undefined;
202
202
 
203
203
  basketId && $http
204
- .post(`api/basket/assign-basket`, null, { params: { basketId: basketId, restaurantId: restaurantId } })
204
+ .post(`api/basket/assign-basket`, { basketId, restaurantId })
205
205
  .then(() => {
206
206
  dispatch('product/getBasket', restaurantId, { root: true })
207
207
  })
@@ -224,7 +224,7 @@ const actions = {
224
224
  }
225
225
  for (let i = 0; i < baskets.length; i++) {
226
226
  $http
227
- .post(`api/basket/unassigned-basket`, null, { params: { basketId: baskets[i] } })
227
+ .post(`api/basket/unassigned-basket`, { basketId: baskets[i] })
228
228
  .then(() => {
229
229
  return {
230
230
  type: 'success',
@@ -346,7 +346,7 @@ const actions = {
346
346
  );
347
347
  },
348
348
  addUserAddress({ dispatch }, data) {
349
- return $http.post('api/auth/user/address/add', null, { params: data }).then((res) => {
349
+ return $http.post('api/auth/user/address/add', data).then((res) => {
350
350
  dispatch('getUserAddress')
351
351
  return {
352
352
  type: 'success',
@@ -357,7 +357,7 @@ const actions = {
357
357
  );
358
358
  },
359
359
  removeUserAddress({ dispatch }, id) {
360
- return $http.put('api/auth/user/address/remove', null, { params: { id } }).then((res) => {
360
+ return $http.put('api/auth/user/address/remove', { id }).then((res) => {
361
361
  dispatch('getUserAddress')
362
362
  return {
363
363
  type: 'success',
@@ -368,7 +368,7 @@ const actions = {
368
368
  );
369
369
  },
370
370
  editUserAddress({ dispatch }, data) {
371
- return $http.post('api/auth/user/address/edit', null, { params: data }).then((res) => {
371
+ return $http.post('api/auth/user/address/edit', data).then((res) => {
372
372
  dispatch('getUserAddress')
373
373
  return {
374
374
  type: 'success',