Added a new API endpoint to get all stock entries per location

References https://www.reddit.com/r/grocy/comments/srfwfs
This commit is contained in:
Bernd Bestel
2022-02-13 20:34:49 +01:00
parent 2457c2c2fd
commit 66bd3f0d59
5 changed files with 83 additions and 0 deletions

View File

@@ -631,6 +631,11 @@ class StockApiController extends BaseApiController
return $this->FilteredApiResponse($response, $this->getStockService()->GetProductStockEntries($args['productId'], false, $allowSubproductSubstitution, true), $request->getQueryParams());
}
public function LocationStockEntries(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
{
return $this->FilteredApiResponse($response, $this->getStockService()->GetLocationStockEntries($args['locationId']), $request->getQueryParams());
}
public function ProductStockLocations(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
{
$allowSubproductSubstitution = false;