getLists überabreitet
This commit is contained in:
1 parent
ea8ebf79b2
commit
d373ecce2b
1 file changed
+5
-4
@@ -4,6 +4,7 @@ import de.timaldinger.einkaufsliste.Dto.Get.*;
|
||||
import de.timaldinger.einkaufsliste.Exceptions.ResourceNotFoundException;
|
||||
import de.timaldinger.einkaufsliste.Mapper.ShoppingCategoryMapper;
|
||||
import de.timaldinger.einkaufsliste.Mapper.ShoppingItemMapper;
|
||||
import de.timaldinger.einkaufsliste.Mapper.ShoppingListMapper;
|
||||
import de.timaldinger.einkaufsliste.Models.ShoppingList;
|
||||
import de.timaldinger.einkaufsliste.Repository.ShoppingCategoryRepository;
|
||||
import de.timaldinger.einkaufsliste.Repository.ShoppingItemRepository;
|
||||
@@ -27,6 +28,8 @@ public class ShoppingListService {
|
||||
private ShoppingCategoryMapper shoppingCategoryMapper;
|
||||
@Autowired
|
||||
private ShoppingItemMapper shoppingItemMapper;
|
||||
@Autowired
|
||||
private ShoppingListMapper shoppingListMapper;
|
||||
|
||||
@Transactional
|
||||
public void deleteList(UUID listID){
|
||||
@@ -35,10 +38,8 @@ public class ShoppingListService {
|
||||
shoppingListRepository.deleteById(listID);
|
||||
}
|
||||
|
||||
public ShoppingListsGetDTO getLists(){
|
||||
return new ShoppingListsGetDTO(shoppingListRepository.findAll().stream()
|
||||
.map(l -> new ShoppingListOneGetDTO(l.getListName(), l.getId())).toList());
|
||||
|
||||
public List<ShoppingListsGetDTO> getLists(){
|
||||
return shoppingListMapper.toListsGetDTOs(shoppingListRepository.findAll());
|
||||
}
|
||||
|
||||
public ShoppingListGetDTO getList(UUID listID){
|
||||
|
||||
Reference in new issue
Block a user