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