Ingredients can now be added to shopping list when a recipe is scheduled

This commit is contained in:
Greg Burri 2025-02-10 15:02:20 +01:00
parent 15173c4842
commit ce3821b94e
12 changed files with 98 additions and 39 deletions

View file

@ -115,10 +115,10 @@ impl RecipeScheduler {
recipe_id: i64,
date: NaiveDate,
servings: u32,
add_ingredients_to_shopping_list: bool,
) -> Result<ScheduleRecipeResult> {
if self.is_local {
// storage.get(format("scheduled_recipes-{}-{}", )
// storage.set("asd", "hello").unwrap();
// TODO: use 'add_ingredients_to_shopping_list'.
let mut recipe_ids_and_dates = load_scheduled_recipes(date.year(), date.month0());
for recipe in recipe_ids_and_dates.iter() {
if recipe.recipe_id == recipe_id && recipe.date == date {
@ -135,6 +135,7 @@ impl RecipeScheduler {
recipe_id,
date,
servings,
add_ingredients_to_shopping_list,
},
)
.await