diff --git a/kbazaar/src/main/java/com/kampus/kbazaar/product/ProductController.java b/kbazaar/src/main/java/com/kampus/kbazaar/product/ProductController.java index 15fdf8f..254d004 100644 --- a/kbazaar/src/main/java/com/kampus/kbazaar/product/ProductController.java +++ b/kbazaar/src/main/java/com/kampus/kbazaar/product/ProductController.java @@ -20,7 +20,6 @@ @Validated public class ProductController { - @Autowired private final ProductService productService; public ProductController(ProductService productService) { diff --git a/kbazaar/src/main/java/com/kampus/kbazaar/product/ProductService.java b/kbazaar/src/main/java/com/kampus/kbazaar/product/ProductService.java index 2eac04d..f6404cd 100644 --- a/kbazaar/src/main/java/com/kampus/kbazaar/product/ProductService.java +++ b/kbazaar/src/main/java/com/kampus/kbazaar/product/ProductService.java @@ -10,9 +10,12 @@ @Service public class ProductService { - @Autowired private ProductRepository productRepository; + public ProductService(ProductRepository productRepository) { + this.productRepository = productRepository; + } + public List getAll() { return productRepository.findAll().stream().map(Product::toResponse).toList(); }