@webresto/graphql 1.3.1 → 1.3.2

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
@@ -60,5 +60,5 @@
60
60
  "test:js": "mocha test/bootstrap.js './test/{,!(fixture)/**}/*.test.js' --exit",
61
61
  "test:init": "cd ./test/fixture && npm i --no-package-lock --prefix ./ && cd -"
62
62
  },
63
- "version": "1.3.1"
63
+ "version": "1.3.2"
64
64
  }
@@ -65,7 +65,8 @@ exports.default = {
65
65
  }
66
66
  }
67
67
  await Order.addDish(order.id, args.dishId, args.amount, args.modifiers || [], args.comment, args.from, args.replace, args.orderDishId);
68
- return await Order.countCart(order);
68
+ await Order.countCart(order);
69
+ return await Order.populate(order.id);
69
70
  },
70
71
  },
71
72
  orderReplaceDish: {
@@ -82,7 +83,8 @@ exports.default = {
82
83
  order = await getNewCart();
83
84
  }
84
85
  await Order.addDish(order.id, args.dishId, args.amount, args.modifiers || [], args.comment, args.from, args.replace, args.orderDishId);
85
- return await Order.countCart(order);
86
+ await Order.countCart(order);
87
+ return await Order.populate(order.id);
86
88
  },
87
89
  },
88
90
  orderRemoveDish: {
@@ -99,7 +101,8 @@ exports.default = {
99
101
  }
100
102
  const orderDish = await OrderDish.findOne({ id: args.orderDishId });
101
103
  await Order.removeDish(order.id, orderDish, args.amount, false);
102
- return await Order.countCart(order);
104
+ await Order.countCart(order);
105
+ return await Order.populate(order.id);
103
106
  },
104
107
  },
105
108
  orderSetDishAmount: {
@@ -120,7 +123,8 @@ exports.default = {
120
123
  if (!dish.dish)
121
124
  throw new errorWrapper_1.Error(0, "ERROR", `Dish in OrderDish with id ${args.orderDishId} not found`);
122
125
  await Order.setCount(order.id, dish, args.amount);
123
- return await Order.countCart(order);
126
+ await Order.countCart(order);
127
+ return await Order.populate(order.id);
124
128
  },
125
129
  },
126
130
  orderSetDishComment: {
@@ -147,7 +151,8 @@ exports.default = {
147
151
  throw new errorWrapper_1.Error(0, "ERROR", `Dish with id ${dishId} not found`);
148
152
  }
149
153
  await order.setComment(dish, comment);
150
- return await Order.countCart(order);
154
+ await Order.countCart(order);
155
+ return await Order.populate(order.id);
151
156
  },
152
157
  },
153
158
  orderUpdate: {
@@ -157,6 +162,7 @@ exports.default = {
157
162
  if (!order.id)
158
163
  throw "order.id field is required";
159
164
  await Order.update({ id: order.id }, { trifleFrom: order.trifleFrom });
165
+ await Order.populate(order.id);
160
166
  return await Order.populate(order.id);
161
167
  },
162
168
  },
@@ -95,7 +95,8 @@ export default {
95
95
  args.replace,
96
96
  args.orderDishId
97
97
  );
98
- return await Order.countCart(order);
98
+ await Order.countCart(order);
99
+ return await Order.populate(order.id);
99
100
  },
100
101
  },
101
102
  orderReplaceDish: {