orderiom-api-package 0.4.72 → 0.4.74
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/modules/order.js +14 -30
- package/src/modules/restaurant.js +1 -1
package/package.json
CHANGED
package/src/modules/order.js
CHANGED
|
@@ -1114,36 +1114,20 @@ const actions = {
|
|
|
1114
1114
|
})
|
|
1115
1115
|
.catch(commonErrorCallback());
|
|
1116
1116
|
},
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
window.location = res.data.data.paymentLink;
|
|
1132
|
-
return res;
|
|
1133
|
-
})
|
|
1134
|
-
.catch(commonErrorCallback());
|
|
1135
|
-
},
|
|
1136
|
-
updateTablePaymentStatus({ commit }, { tablePaymentId, status , orderId }) {
|
|
1137
|
-
return $http
|
|
1138
|
-
.get(`/api/table-payments/update`, {
|
|
1139
|
-
params: { tablePaymentId, status, orderId },
|
|
1140
|
-
})
|
|
1141
|
-
.then((res) => {
|
|
1142
|
-
const status = res.data.data.status;
|
|
1143
|
-
commit("setTablePaymentStatus", status);
|
|
1144
|
-
return res;
|
|
1145
|
-
})
|
|
1146
|
-
.catch(commonErrorCallback());
|
|
1117
|
+
broadcastTablePaymentEvent({ commit }, { tablePaymentId, basketItems, action, socketId}) {
|
|
1118
|
+
$http.interceptors.request.use((config) => {
|
|
1119
|
+
// we need to send this header so we don't receive events
|
|
1120
|
+
// dispatched by the same client
|
|
1121
|
+
if (socketId) {
|
|
1122
|
+
config.headers['X-Socket-Id'] = socketId;
|
|
1123
|
+
}
|
|
1124
|
+
return config;
|
|
1125
|
+
});
|
|
1126
|
+
return $http.post('/api/table-payments/events', {
|
|
1127
|
+
tablePaymentId,
|
|
1128
|
+
basketItems,
|
|
1129
|
+
action
|
|
1130
|
+
}).catch(commonErrorCallback());
|
|
1147
1131
|
},
|
|
1148
1132
|
getExternalTableOrdersFromPayment({ commit }, { tablePaymentId }) {
|
|
1149
1133
|
return $http
|
|
@@ -82,7 +82,7 @@ const actions = {
|
|
|
82
82
|
const params = type === 'slug' ? {slug: restaurantId} : {restaurantId};
|
|
83
83
|
commit('startFetchingRestaurantInfo');
|
|
84
84
|
return $http.get('api/restaurant/restaurant-by-' + type, { params }).then(result => {
|
|
85
|
-
|
|
85
|
+
result.data.data[0] && commit('setRestaurantInfo', result.data.data[0]);
|
|
86
86
|
}).catch(
|
|
87
87
|
commonErrorCallback()
|
|
88
88
|
).finally(() => {
|