mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Allow recipe ingredients to be ignored when putting them on the shopping list (closes #125)
This commit is contained in:
@@ -16,7 +16,15 @@ class RecipesApiController extends BaseApiController
|
||||
|
||||
public function AddNotFulfilledProductsToShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$this->RecipesService->AddNotFulfilledProductsToShoppingList($args['recipeId']);
|
||||
$requestBody = $request->getParsedBody();
|
||||
$excludedProductIds = null;
|
||||
|
||||
if ($requestBody !== null && array_key_exists('excludedProductIds', $requestBody))
|
||||
{
|
||||
$excludedProductIds = $requestBody['excludedProductIds'];
|
||||
}
|
||||
|
||||
$this->RecipesService->AddNotFulfilledProductsToShoppingList($args['recipeId'], $excludedProductIds);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user