fix: Bulk Add Recipes to Shopping List #5054
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
(REQUIRED)
This PR updates the endpoint for adding a recipe to a shopping list to accept multiple recipes. This improves speed when adding multiple recipes from the meal planner, and fixes a bug where items aren't merged properly due to race conditions.
Which issue(s) this PR fixes:
(REQUIRED)
Fixes #3417
Special notes for your reviewer:
(fill-in or delete this section)
I kept the old endpoint + signature so existing integrations don't break, but I marked it as deprecated in the docs. In a future version we can just get rid of it.
Testing
(fill-in or delete this section)
Updated pytest with the new route and added a new test for a new edgecase. I also tested the frontend any time that endpoint is called (from the meal planner, from a recipe, from the shopping list page).