neuen Listenname zu listName im DTO geändert
This commit is contained in:
1 parent
fcd902fd26
commit
200f23c5e1
2 files changed
+2
-2
No files matched your search
@@ -61,7 +61,7 @@ public class ShoppingListController {
|
||||
public ResponseEntity<Void> editList(@PathVariable UUID listID,@Valid @RequestBody ShoppingListPatchDTO toChange){
|
||||
ShoppingList list = shoppingListRepository.findById(listID).orElseThrow(() -> new ResourceNotFoundException("listID", listID));
|
||||
|
||||
if(toChange.newListName() != null) list.setListName(toChange.newListName());
|
||||
if(toChange.listName() != null) list.setListName(toChange.listName());
|
||||
|
||||
shoppingListRepository.save(list);
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ package de.timaldinger.einkaufsliste.Dto.Patch;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
public record ShoppingListPatchDTO(@NotBlank(message = "listName must not be blank!") String newListName) {
|
||||
public record ShoppingListPatchDTO(@NotBlank(message = "listName must not be blank!") String listName) {
|
||||
}
|
||||
Reference in new issue
Block a user