orderiom-api-package 0.3.19 → 0.3.20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orderiom-api-package",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
4
4
  "description": "This package will install all necessary API calls for every orderiom restaurant",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -395,7 +395,24 @@ const actions = {
395
395
  // commit('setorder', res.data.data.order)
396
396
  // commit('setuserOrder', JSON.parse(res.data.data.order.user_details));
397
397
  // commit('setshippigPriceOrder', res.data.data.order.shipping_price);
398
- window.location = res.data.data.paymentLink;
398
+
399
+ if(!data.$router || !data.routeName){
400
+ window.location = res.data.data.paymentLink;
401
+ }else{
402
+ data.$router.push({
403
+ name: data.routeName,
404
+ query: res.data.data.paymentLink
405
+ .split('?')[1]
406
+ .split('&')
407
+ .map(query => query.split('='))
408
+ .reduce((result, element) => {
409
+ if(!element) return result;
410
+ result[element[0]] = element[1];
411
+ return result;
412
+ }, {})
413
+ });
414
+ }
415
+
399
416
  var index = data.basket ? basketData.indexOf(basketData.find((item) => item.basketId == data.basket)) :
400
417
  basketData.indexOf(basketData.find((item) => item.restaurantId == data.restaurantId));
401
418
  if (index > -1) {