Commit 06946133 authored by Ben Anderson's avatar Ben Anderson

Fixed incorrect collection reference in Model

parent 194e8d3a
...@@ -8,7 +8,7 @@ import org.springframework.data.mongodb.core.mapping.Document; ...@@ -8,7 +8,7 @@ import org.springframework.data.mongodb.core.mapping.Document;
@Getter @Getter
@Setter @Setter
@Document(collection = "Products") @Document(collection = "products")
public class Product { public class Product {
@Id @Id
private String id; private String id;
......
...@@ -13,9 +13,9 @@ public class ProductService { ...@@ -13,9 +13,9 @@ public class ProductService {
ProductRepository productRepository; ProductRepository productRepository;
public Mono<ProductDto> createProduct(Product product) { public Mono<ProductDto> createProduct(Product product) {
// TODO: Add explicit check for existing SKU
return productRepository.save(product) return productRepository.save(product)
.map(ProductDto::generateDtoFromProduct) .map(ProductDto::generateDtoFromProduct)
.onErrorMap(throwable -> throwable);
} }
} }
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