|
|
|
@ -22,6 +22,7 @@ import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
@ -57,19 +58,19 @@ public class ToBuysController { |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
@PostMapping("/add") |
|
|
|
|
public ResponseEntity<String> addToBuys( |
|
|
|
|
public ResponseEntity<Map<String, Boolean>> addToBuys( |
|
|
|
|
@Valid @RequestBody ToBuysDTO dto, |
|
|
|
|
Authentication authentication) { |
|
|
|
|
toBuysService.addToBuys(dto, authentication); |
|
|
|
|
return ResponseEntity.ok("Item added to 'To Buys' successfully"); |
|
|
|
|
return ResponseEntity.ok(Collections.singletonMap("result", true)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PutMapping("/update") |
|
|
|
|
public ResponseEntity<String> updateToBuys( |
|
|
|
|
public ResponseEntity<Map<String, Boolean>> updateToBuys( |
|
|
|
|
@Valid @RequestBody ToBuysDTO dto, |
|
|
|
|
Authentication authentication) { |
|
|
|
|
toBuysService.updateToBuys(dto, authentication); |
|
|
|
|
return ResponseEntity.ok("Item updated to 'To Buys' successfully"); |
|
|
|
|
return ResponseEntity.ok(Collections.singletonMap("result", true)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|