orderiom-api-package 0.4.73 → 0.4.75
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 +16 -31
package/package.json
CHANGED
package/src/modules/order.js
CHANGED
|
@@ -1102,11 +1102,12 @@ const actions = {
|
|
|
1102
1102
|
return false;
|
|
1103
1103
|
});
|
|
1104
1104
|
},
|
|
1105
|
-
getTableExternalOrder({ commit }, { restaurantId, tableName }) {
|
|
1105
|
+
getTableExternalOrder({ commit }, { restaurantId, tablePaymentId, tableName }) {
|
|
1106
1106
|
commit("setExternalTableOrders", {});
|
|
1107
1107
|
return $http
|
|
1108
1108
|
.post("api/table-payments/create", {
|
|
1109
1109
|
restaurantId,
|
|
1110
|
+
tablePaymentId,
|
|
1110
1111
|
tableName,
|
|
1111
1112
|
})
|
|
1112
1113
|
.then((res) => {
|
|
@@ -1114,36 +1115,20 @@ const actions = {
|
|
|
1114
1115
|
})
|
|
1115
1116
|
.catch(commonErrorCallback());
|
|
1116
1117
|
},
|
|
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());
|
|
1118
|
+
broadcastTablePaymentEvent({ commit }, { tablePaymentId, basketItems, action, socketId}) {
|
|
1119
|
+
$http.interceptors.request.use((config) => {
|
|
1120
|
+
// we need to send this header so we don't receive events
|
|
1121
|
+
// dispatched by the same client
|
|
1122
|
+
if (socketId) {
|
|
1123
|
+
config.headers['X-Socket-Id'] = socketId;
|
|
1124
|
+
}
|
|
1125
|
+
return config;
|
|
1126
|
+
});
|
|
1127
|
+
return $http.post('/api/table-payments/events', {
|
|
1128
|
+
tablePaymentId,
|
|
1129
|
+
basketItems,
|
|
1130
|
+
action
|
|
1131
|
+
}).catch(commonErrorCallback());
|
|
1147
1132
|
},
|
|
1148
1133
|
getExternalTableOrdersFromPayment({ commit }, { tablePaymentId }) {
|
|
1149
1134
|
return $http
|