orderiom-api-package 0.4.47 → 0.4.48

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.47",
3
+ "version": "0.4.48",
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",
@@ -1,4 +1,4 @@
1
- import {commonErrorCallback, calculateBasketIdParameter, updateBasket, deliveryCodeToName, weekdays, $http} from '../common';
1
+ import {commonErrorCallback, calculateBasketIdParameter, updateBasket, formatDate, formatTime, deliveryCodeToName, weekdays, $http} from '../common';
2
2
 
3
3
  const state = () => ({
4
4
  selectedTime: null,
@@ -323,11 +323,21 @@ const actions = {
323
323
  } catch(e) {
324
324
  console.error("getProducts: " + e);
325
325
  }
326
+
327
+ let delivery_time = undefined;
328
+ if(state.deliveryTime){
329
+ delivery_time = new Date(state.deliveryTime);
330
+ delivery_time = [
331
+ formatDate(delivery_time),
332
+ formatTime(delivery_time)
333
+ ].join(' ')
334
+ }
335
+
326
336
  return $http.get("api/restaurant/products", {
327
337
  params: {
328
338
  categoryId: data.category.id,
329
339
  restaurantId: data.restaurantId,
330
- delivery_time: state.deliveryTime || undefined,
340
+ delivery_time,
331
341
  basketId: basketId
332
342
  }
333
343
  }).then(res => {