mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 15:49:42 +02:00
feat: select ingredients to add to shopping List (#2136)
* added recipe ingredient override to backend * pytest * new dialog to filter recipe items added to list
This commit is contained in:
parent
89b003589d
commit
5562effd66
8 changed files with 215 additions and 18 deletions
|
@ -1,4 +1,5 @@
|
|||
import { BaseCRUDAPI } from "../base/base-clients";
|
||||
import { RecipeIngredient } from "../types/recipe";
|
||||
import { ApiRequestInstance } from "~/lib/api/types/non-generated";
|
||||
import {
|
||||
ShoppingListCreate,
|
||||
|
@ -25,12 +26,12 @@ export class ShoppingListsApi extends BaseCRUDAPI<ShoppingListCreate, ShoppingLi
|
|||
baseRoute = routes.shoppingLists;
|
||||
itemRoute = routes.shoppingListsId;
|
||||
|
||||
async addRecipe(itemId: string, recipeId: string, recipeIncrementQuantity = 1) {
|
||||
return await this.requests.post(routes.shoppingListIdAddRecipe(itemId, recipeId), {recipeIncrementQuantity});
|
||||
async addRecipe(itemId: string, recipeId: string, recipeIncrementQuantity = 1, recipeIngredients: RecipeIngredient[] | null = null) {
|
||||
return await this.requests.post(routes.shoppingListIdAddRecipe(itemId, recipeId), { recipeIncrementQuantity, recipeIngredients });
|
||||
}
|
||||
|
||||
async removeRecipe(itemId: string, recipeId: string, recipeDecrementQuantity = 1) {
|
||||
return await this.requests.post(routes.shoppingListIdRemoveRecipe(itemId, recipeId), {recipeDecrementQuantity});
|
||||
return await this.requests.post(routes.shoppingListIdRemoveRecipe(itemId, recipeId), { recipeDecrementQuantity });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue