Commit 0498ba10 authored by Vladimir Trubachoff's avatar Vladimir Trubachoff

Fix goods controller

parent 7ca3937b
...@@ -54,10 +54,10 @@ public class GoodsController { ...@@ -54,10 +54,10 @@ public class GoodsController {
@PutMapping("/{id}") @PutMapping("/{id}")
public GoodsDto updateGoods(@PathVariable Long id, @RequestBody GoodsDto goods) { public GoodsDto updateGoods(@PathVariable Long id, @RequestBody GoodsDto goods) {
GoodsDto updatedOrder = goodsService.getGoods(id); GoodsDto updatedGoods = goodsService.getGoods(id);
updatedOrder.setName(goods.getName()); updatedGoods.setName(goods.getName());
updatedOrder.setPrice(goods.getPrice()); updatedGoods.setPrice(goods.getPrice());
return updatedOrder; return this.goodsService.createOrUpdate(mappingUtils.toGoods(updatedGoods));
} }
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment