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 +1 -1
- package/src/common.js +7 -5
- package/src/modules/auth.js +6 -6
package/package.json
CHANGED
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 = () =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 => {
|
package/src/modules/auth.js
CHANGED
|
@@ -74,7 +74,7 @@ const actions = {
|
|
|
74
74
|
delete data.ordermood
|
|
75
75
|
}
|
|
76
76
|
return $http
|
|
77
|
-
.post(`api/auth/login`,
|
|
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`,
|
|
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`,
|
|
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',
|
|
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',
|
|
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',
|
|
371
|
+
return $http.post('api/auth/user/address/edit', data).then((res) => {
|
|
372
372
|
dispatch('getUserAddress')
|
|
373
373
|
return {
|
|
374
374
|
type: 'success',
|