orderiom-api-package 0.4.8 → 0.4.9
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/auth.js +5 -2
package/package.json
CHANGED
package/src/modules/auth.js
CHANGED
|
@@ -197,7 +197,8 @@ const actions = {
|
|
|
197
197
|
assignBasket({ dispatch }, restaurantId) {
|
|
198
198
|
const basket = JSON.parse(localStorage.getItem("basket"));
|
|
199
199
|
if(!basket || !Array.isArray(basket)) return;
|
|
200
|
-
const
|
|
200
|
+
const foundBasket = basket.find(item => Number(item.restaurantId) === Number(restaurantId || restaurantIdEnv))
|
|
201
|
+
const basketId = foundBasket ? foundBasket.basketId : undefined;
|
|
201
202
|
|
|
202
203
|
basketId && $http
|
|
203
204
|
.post(`api/basket/assign-basket`, null, { params: { basketId: basketId, restaurantId: restaurantId } })
|
|
@@ -214,7 +215,9 @@ const actions = {
|
|
|
214
215
|
let baskets = [];
|
|
215
216
|
|
|
216
217
|
if (restaurantId || restaurantIdEnv) {
|
|
217
|
-
const
|
|
218
|
+
const foundBasket = basket.find(item => Number(item.restaurantId) === Number(restaurantId || restaurantIdEnv))
|
|
219
|
+
const basketId = foundBasket ? foundBasket.basketId : undefined;
|
|
220
|
+
|
|
218
221
|
if(basketId) baskets.push(basketId);
|
|
219
222
|
} else {
|
|
220
223
|
baskets = basket.map(m => m.basketId)
|