orderiom-api-package 0.4.116 → 0.5.1
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/messages/de-api.json +2 -2
- package/src/modules/order.js +43 -0
package/package.json
CHANGED
package/src/messages/de-api.json
CHANGED
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"your_reset_password_has_emailed": "Wir haben Ihren Link zum Zurücksetzen Ihres Passworts per E-Mail gesendet!",
|
|
107
107
|
"you_dont_allow": "Sie haben keine Erlaubnis dazu.",
|
|
108
108
|
"restaurant_id_or_basket_id_is_required": "Sie sollten entweder eine gültige BasketId oder eine RestaurantId einfügen.",
|
|
109
|
-
"Restaurant_is_not_Open": "Das Restaurant ist
|
|
109
|
+
"Restaurant_is_not_Open": "Das Restaurant ist zur gewünschten Zeit nicht geöffnet.",
|
|
110
110
|
"these_credentials_do_not_match": "Es wurde kein Benutzer mit diesem Profil gefunden",
|
|
111
111
|
"total_price_is_zero": "Gesamtpreis ist Null.",
|
|
112
112
|
"your_total_price_cannot_be_less_than": "Sie haben Ihren Mindestbestellwert nicht erreicht.",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"the_product_quantity_limit_reached": "Leider sind nur {inStock} Artikel von {name} verfügbar.",
|
|
144
144
|
|
|
145
145
|
"request_submitted": "Ihre Anfrage wurde übermittelt!",
|
|
146
|
-
"restaurant_past_time": "Das Restaurant ist
|
|
146
|
+
"restaurant_past_time": "Das Restaurant ist zur gewünschten Zeit nicht geöffnet.",
|
|
147
147
|
"we have updates! please refresh.": "Wir haben Updates! Bitte aktualisieren.",
|
|
148
148
|
"invoice": "Auf Rechnung",
|
|
149
149
|
"pattern_name_is_required": "Mustername ist erforderlich.",
|
package/src/modules/order.js
CHANGED
|
@@ -202,6 +202,49 @@ const actions = {
|
|
|
202
202
|
if (basketProduct) basketProduct.changingQuantity = false;
|
|
203
203
|
});
|
|
204
204
|
},
|
|
205
|
+
addMultipleItemsToBasket({ dispatch, rootState }, data) {
|
|
206
|
+
let basketId = undefined;
|
|
207
|
+
try {
|
|
208
|
+
basketId = calculateBasketIdParameter(data ? data.restaurantId : undefined);
|
|
209
|
+
} catch (e) {
|
|
210
|
+
console.error(e);
|
|
211
|
+
return { type: "error", msg: "Basket not found" };
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
data.items.map(item => {
|
|
215
|
+
item.basketProduct = !item.basketProductId
|
|
216
|
+
? null
|
|
217
|
+
: rootState.orderiomApiPackage.product.ShoppingCart.find(f => f.basketProductId === item.basketProductId);
|
|
218
|
+
if (item.basketProduct) item.basketProduct.changingQuantity = true;
|
|
219
|
+
|
|
220
|
+
item.quantity = parseInt(item.quantity);
|
|
221
|
+
item.quantity = !item.quantity || item.quantity < 1 ? 1 : item.quantity;
|
|
222
|
+
|
|
223
|
+
item.basketProductId = item.basketProductId ? item.basketProductId : undefined;
|
|
224
|
+
item.attributeItems = item.attributeItems && item.attributeItems.length ? item.attributeItems : undefined;
|
|
225
|
+
item.productAttributeItems = item.productAttributeItems && item.productAttributeItems.length
|
|
226
|
+
? item.productAttributeItems
|
|
227
|
+
: undefined;
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
$http
|
|
231
|
+
.post("api/basket/add-multiple", {
|
|
232
|
+
restaurantId: data.restaurantId,
|
|
233
|
+
basketId,
|
|
234
|
+
items: data.items
|
|
235
|
+
})
|
|
236
|
+
.then(async () => {
|
|
237
|
+
return await dispatch("shoppingCartUpdateCallback", {
|
|
238
|
+
restaurantId: data.restaurantId,
|
|
239
|
+
});
|
|
240
|
+
})
|
|
241
|
+
.catch(commonErrorCallback())
|
|
242
|
+
.finally(() => {
|
|
243
|
+
data.items.map(item => {
|
|
244
|
+
if (item.basketProduct) item.basketProduct.changingQuantity = false;
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
},
|
|
205
248
|
removeFromBasket({ dispatch, rootState }, data) {
|
|
206
249
|
const basketProduct =
|
|
207
250
|
rootState.orderiomApiPackage.product.ShoppingCart.find(
|