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

Fix goods controller

parent 7ca3937b
......@@ -54,10 +54,10 @@ public class GoodsController {
@PutMapping("/{id}")
public GoodsDto updateGoods(@PathVariable Long id, @RequestBody GoodsDto goods) {
GoodsDto updatedOrder = goodsService.getGoods(id);
updatedOrder.setName(goods.getName());
updatedOrder.setPrice(goods.getPrice());
return updatedOrder;
GoodsDto updatedGoods = goodsService.getGoods(id);
updatedGoods.setName(goods.getName());
updatedGoods.setPrice(goods.getPrice());
return this.goodsService.createOrUpdate(mappingUtils.toGoods(updatedGoods));
}
@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