Skip to content
Snippets Groups Projects
Commit 4091cea0 authored by Stian Lyng Stræte's avatar Stian Lyng Stræte
Browse files

Merge branch 'enhance-weekly-menu-suggestion' into 'main'

limit items to 5

See merge request idatt2106-v23-03/backend!221
parents fa1c7b14 b659af91
No related branches found
No related tags found
No related merge requests found
......@@ -229,7 +229,13 @@ public class RecipeService {
Collections.shuffle(zeroMatchRecipes);
// Combine the commonRecipes and zeroMatchRecipes lists
commonRecipes.addAll(zeroMatchRecipes);
for (RecipeWithMatchCount zeroMatchRecipe : zeroMatchRecipes) {
if (commonRecipes.size() < 5) {
commonRecipes.add(zeroMatchRecipe);
} else {
break;
}
}
return commonRecipes;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment