mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-11-03 18:53:17 -05: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:
		@@ -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 });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user