mirror of
https://github.com/grocy/grocy.git
synced 2025-08-13 01:06:23 +00:00
Added more product actions on the stock overview page (closes #327)
This commit is contained in:
@@ -448,4 +448,23 @@ class StockApiController extends BaseApiController
|
||||
{
|
||||
return $this->ApiResponse($this->StockService->GetProductStockEntries($args['productId']));
|
||||
}
|
||||
|
||||
public function StockBooking(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$stockLogRow = $this->Database->stock_log($args['bookingId']);
|
||||
|
||||
if ($stockLogRow === null)
|
||||
{
|
||||
throw new \Exception('Stock booking does not exist');
|
||||
}
|
||||
|
||||
return $this->ApiResponse($stockLogRow);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user