Moved services
This commit is contained in:
parent
b7116a0882
commit
0050671944
2 changed files with 5 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
package service;
|
||||
package server.service;
|
||||
|
||||
import commons.Ingredient;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package service;
|
||||
package server.service;
|
||||
|
||||
import commons.Recipe;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
|
@ -65,9 +65,11 @@ public class RecipeService {
|
|||
return Optional.of(saveWithDependencies(recipe));
|
||||
}
|
||||
|
||||
public void delete(Long id) {
|
||||
public boolean delete(Long id) {
|
||||
// TODO: Propagate deletion to ingredients.
|
||||
if (!recipeRepository.existsById(id)) return false;
|
||||
recipeRepository.deleteById(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
private Recipe saveWithDependencies(Recipe recipe) {
|
||||
Loading…
Add table
Add a link
Reference in a new issue