Skip to content

Save ingredient to cache on selection #932

@rolandgeider

Description

@rolandgeider

Use case

Currently when the user searches for an ingredient, e.g. when logging a single ingredient to a meal, we need to re-fectch it so it gets saved to the cache.

Proposal

When an ingredient is selected on the autocomplete (see uses of NutritionPlansProvider.searchIngredient), we should save it to the cache. We would refactor fetchIngredient and extract the logic to save the ingredient to the cache to a new function so that we can use it in the autocomplete.

Additional Context

No response

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions