orderiom-api-package 0.3.37 → 0.3.39
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 +5 -1
- package/src/modules/product.js +0 -46
package/package.json
CHANGED
package/src/modules/order.js
CHANGED
|
@@ -385,7 +385,11 @@ const actions = {
|
|
|
385
385
|
.post("api/order/create-order", {
|
|
386
386
|
...basketId,
|
|
387
387
|
...restaurantID,
|
|
388
|
-
paymentType: data.paymentType
|
|
388
|
+
paymentType: data.paymentType,
|
|
389
|
+
...(data.paymentType === 'payFix' && {
|
|
390
|
+
qrCode: data.payfix_qrcode,
|
|
391
|
+
pin: data.payfix_pin
|
|
392
|
+
}),
|
|
389
393
|
})
|
|
390
394
|
.then((res) => {
|
|
391
395
|
// localStorage.setItem("orderId", res.data.data.order.id);
|
package/src/modules/product.js
CHANGED
|
@@ -145,52 +145,6 @@ const mutations = {
|
|
|
145
145
|
};
|
|
146
146
|
const actions = {
|
|
147
147
|
// TODO: note the $http in loop
|
|
148
|
-
// Orderiom api doesn't use this function
|
|
149
|
-
// check whether ordermood is using this function or not
|
|
150
|
-
getCategoriesWithProducts({ commit, dispatch }, restaurantId) {
|
|
151
|
-
return $http
|
|
152
|
-
.get("api/restaurant/category", { params: { restaurantId: restaurantId } })
|
|
153
|
-
.then((res) => {
|
|
154
|
-
let categories = res.data.data
|
|
155
|
-
commit("setSelectedCategory", categories[0]);
|
|
156
|
-
$http
|
|
157
|
-
.get("api/restaurant/category", { params: { restaurantId: restaurantId, extra: 1 } })
|
|
158
|
-
.then((res) => {
|
|
159
|
-
if (res.data.data.length) {
|
|
160
|
-
categories = [...categories, ...res.data.data];
|
|
161
|
-
for (let i = 0; i < categories.length; i++) {
|
|
162
|
-
const element = categories[i];
|
|
163
|
-
dispatch("getProducts", {
|
|
164
|
-
category: element,
|
|
165
|
-
restaurantId: restaurantId,
|
|
166
|
-
})
|
|
167
|
-
.then((res) => {
|
|
168
|
-
Vue.set(element, 'products', res.data);
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
commit('setCategories', categories);
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
commit('setCategories', categories);
|
|
175
|
-
for (let i = 0; i < categories.length; i++) {
|
|
176
|
-
const element = categories[i];
|
|
177
|
-
dispatch("getProducts", {
|
|
178
|
-
category: element,
|
|
179
|
-
restaurantId: restaurantId,
|
|
180
|
-
})
|
|
181
|
-
.then((res) => {
|
|
182
|
-
Vue.set(element, 'products', res.data)
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
})
|
|
188
|
-
})
|
|
189
|
-
.catch(
|
|
190
|
-
commonErrorCallback()
|
|
191
|
-
);
|
|
192
|
-
},
|
|
193
|
-
|
|
194
148
|
getCategories({ commit, dispatch }, restaurantId) {
|
|
195
149
|
return $http
|
|
196
150
|
.get("api/restaurant/category", { params: { restaurantId: restaurantId } })
|