addCategory wift 404 bei falscher ListID

This commit is contained in:
Technoir committed 2026-10-11 13:36:16 +02:00
1 parent 7bec1e7b5c
commit 17b7f485f6
1 file changed
+1 -1
@@ -35,7 +35,7 @@ public class ShoppingCategoryController {
public ShoppingCategoryResponseDTO addCategory(@RequestBody ShoppingCategoryPostDTO newCategory){
String name = newCategory.categoryName();
ShoppingList list = shoppingListRepository.findById(newCategory.listID()).orElseThrow();
ShoppingList list = shoppingListRepository.findById(newCategory.listID()).orElseThrow(() -> new ResourceNotFoundException("listID",newCategory.listID()));
ShoppingCategory category = new ShoppingCategory(name, List.of(),list);