From d56b07f2aa8b7976a2713cc69b54a726ec44cef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Rasie=C5=84ski?= Date: Wed, 7 Jan 2026 23:46:40 +0100 Subject: [PATCH] comment and access fixes for RecipeService --- server/src/main/java/service/RecipeService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/service/RecipeService.java b/server/src/main/java/service/RecipeService.java index 57cdf16..1c0ea4e 100644 --- a/server/src/main/java/service/RecipeService.java +++ b/server/src/main/java/service/RecipeService.java @@ -24,22 +24,22 @@ public class RecipeService { this.recipeIngredientRepository = recipeIngredientRepository; } - Optional findById(Long id) { + public Optional findById(Long id) { return recipeRepository.findById(id); } - List findAll() { + public List findAll() { return recipeRepository.findAll(); } - List findAll(int limit) { + public List findAll(int limit) { return recipeRepository.findAll(PageRequest.of(0, limit)).toList(); } /** * Creates a new recipe. Returns empty if the recipe with the same name already exists. * @param recipe Recipe to be saved in the db. - * @return The created recipe (the recipe arg with a new assigned id). + * @return The created recipe (the recipe arg with a new assigned id) or empty if it already exists in db. */ public Optional create(Recipe recipe) { if (recipeRepository.existsByName(recipe.getName())) {