Skip to content
Snippets Groups Projects
Commit dcf5a719 authored by Pedro Pablo Cardona Arroyave's avatar Pedro Pablo Cardona Arroyave
Browse files

Little bug fix

parent ff44b47a
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ public class WasteService { ...@@ -26,7 +26,7 @@ public class WasteService {
Optional<Group> group = groupRepository.findByGroupId(wasteRequest.groupId()); Optional<Group> group = groupRepository.findByGroupId(wasteRequest.groupId());
Optional<Product> product = productRepository.findById(wasteRequest.ean()); Optional<Product> product = productRepository.findById(wasteRequest.ean());
if(group.isPresent() && product.isPresent()){ if(group.isPresent() && product.isPresent()){
return Optional.of(wasteRepository.save(Waste.builder().unit(wasteRequest.unit()).wasteId(100L).timestamp(new Timestamp(System.currentTimeMillis())).amount(wasteRequest.amount()).ean(product.get()).groupId(group.get()).build())); return Optional.of(wasteRepository.save(Waste.builder().unit(wasteRequest.unit()).timestamp(new Timestamp(System.currentTimeMillis())).amount(wasteRequest.amount()).ean(product.get()).groupId(group.get()).build()));
} }
return Optional.empty(); return Optional.empty();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment