mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16:15 +02:00
Fix this also for transferring a product
This commit is contained in:
parent
cf0162cb54
commit
2e8977811f
|
|
@ -817,6 +817,18 @@ class StockApiController extends BaseApiController
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$args['productId'] = $this->getStockService()->GetProductIdFromBarcode($args['barcode']);
|
$args['productId'] = $this->getStockService()->GetProductIdFromBarcode($args['barcode']);
|
||||||
|
|
||||||
|
if (Grocycode::Validate($args['barcode']))
|
||||||
|
{
|
||||||
|
$gc = new Grocycode($args['barcode']);
|
||||||
|
if ($gc->GetExtraData())
|
||||||
|
{
|
||||||
|
$requestBody = $request->getParsedBody();
|
||||||
|
$requestBody['stock_entry_id'] = $gc->GetExtraData()[0];
|
||||||
|
$request = $request->withParsedBody($requestBody);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $this->TransferProduct($request, $response, $args);
|
return $this->TransferProduct($request, $response, $args);
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user