mirror of
				https://github.com/grocy/grocy.git
				synced 2025-10-31 02:36:54 +00:00 
			
		
		
		
	Add a "consume all ingredients of this recipe" button (this now closes #32)
This commit is contained in:
		| @@ -19,4 +19,17 @@ class RecipesApiController extends BaseApiController | ||||
| 		$this->RecipesService->AddNotFulfilledProductsToShoppingList($args['recipeId']); | ||||
| 		return $this->VoidApiActionResponse($response); | ||||
| 	} | ||||
|  | ||||
| 	public function ConsumeRecipe(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args) | ||||
| 	{ | ||||
| 		try | ||||
| 		{ | ||||
| 			$this->RecipesService->ConsumeRecipe($args['recipeId']); | ||||
| 			return $this->VoidApiActionResponse($response); | ||||
| 		} | ||||
| 		catch (\Exception $ex) | ||||
| 		{ | ||||
| 			return $this->VoidApiActionResponse($response, false, 400, $ex->getMessage()); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user