Commit dd26d3cf authored by Khai Yuan ​Liew's avatar Khai Yuan ​Liew

[AFP-55] Renamed GET controller method name

parent b3798ff3
......@@ -16,7 +16,7 @@ public class ProductController {
ProductService productService;
@GetMapping()
public ResponseEntity<Flux<ProductDto>> findAll() {
return ResponseEntity.ok(productService.findAll());
public ResponseEntity<Flux<ProductDto>> getAllProducts() {
return ResponseEntity.ok(productService.findAllProducts());
}
}
......@@ -12,8 +12,7 @@ public class ProductService {
@Autowired
ProductRepository productRepository;
public Flux<ProductDto> findAll() {
public Flux<ProductDto> findAllProducts() {
return productRepository.findAll()
.map(ProductDto::generateDtoFromProduct)
.flatMap(Flux::just);
......
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