Skip to content
Snippets Groups Projects
Commit 39be2b89 authored by Birk Øvstetun Narvhus's avatar Birk Øvstetun Narvhus
Browse files

fixed add to shoppinglist endpoint

parent c0a9d87b
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,7 @@ public class ShoppingListService {
shoppingListRepository.findById(shoppingListId).ifPresent(shoppingList -> {
productRepository.findById(ean).ifPresent(product -> {
shoppingList.addProduct(product);
product.addShoppingList(shoppingList);
shoppingListRepository.save(shoppingList);
});
});
......
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