addCategory wift 404 bei falscher ListID
This commit is contained in:
1 parent
7bec1e7b5c
commit
17b7f485f6
1 file changed
+1
-1
+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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user