mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 10:14:39 +00:00
Consume any subproduct when consuming a recipe ingredient which is not in stock (fixes #446)
This commit is contained in:
@@ -567,7 +567,13 @@ class StockApiController extends BaseApiController
|
||||
|
||||
public function ProductStockEntries(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->StockService->GetProductStockEntries($args['productId']));
|
||||
$allowSubproductSubstitution = false;
|
||||
if (isset($request->getQueryParams()['include_sub_products']) && boolval($request->getQueryParams()['include_sub_products']))
|
||||
{
|
||||
$allowSubproductSubstitution = true;
|
||||
}
|
||||
|
||||
return $this->ApiResponse($this->StockService->GetProductStockEntries($args['productId'], false, $allowSubproductSubstitution));
|
||||
}
|
||||
|
||||
public function ProductStockLocations(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
|
Reference in New Issue
Block a user