orderiom-api-package 0.4.21 → 0.4.22

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.4.21",
3
+ "version": "0.4.22",
4
4
  "description": "This package will install all necessary API calls for every orderiom restaurant",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -85,20 +85,9 @@ const actions = {
85
85
  },
86
86
  createBasket({}, data) {
87
87
  var basketData = JSON.parse(localStorage.getItem("basket") || "[]");
88
- let delivery_time = data.delivery_time
89
- ? { delivery_time: data.delivery_time }
90
- : null;
91
- // Date.prototype.addHours = function (h) {
92
- // this.setTime(this.getTime() + (h * 60 * 60 * 1000));
93
- // return this;
94
- // }
95
- // var date = new Date().addHours(1);
96
- // let delivery_time =
97
- // `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()
98
- // } ${(date.getHours()).toString().padStart(2, '0')}:${(date.getMinutes()).toString().padStart(2, '0')}`
99
88
  return $http
100
89
  .post("api/basket/create", {
101
- ...delivery_time,
90
+ delivery_time: data && data.delivery_time ? data.delivery_time : null,
102
91
  restaurantId: data ? data.restaurantId : undefined,
103
92
  })
104
93
  .then((res) => {
@@ -359,7 +359,7 @@ const actions = {
359
359
  );
360
360
  },
361
361
  getBasket({ commit, rootState }, data) {
362
- if(typeof data === 'string' || typeof data === 'number') data = {restaurantId: data};
362
+ if(['string', 'number', 'undefined'].includes(typeof data)) data = {restaurantId: data};
363
363
 
364
364
  let basketId = undefined;
365
365
  try{