mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Finalized frontend external barcode lookup implementation (references #158)
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Helpers\Grocycode;
|
||||
use Grocy\Services\RecipesService;
|
||||
use DI\Container;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
@@ -11,6 +12,24 @@ class StockController extends BaseController
|
||||
{
|
||||
use GrocycodeTrait;
|
||||
|
||||
public function __construct(Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
|
||||
try
|
||||
{
|
||||
$externalBarcodeLookupPluginName = $this->getStockService()->GetExternalBarcodeLookupPluginName();
|
||||
}
|
||||
catch (\Exception)
|
||||
{
|
||||
$externalBarcodeLookupPluginName = '';
|
||||
}
|
||||
finally
|
||||
{
|
||||
$this->View->set('ExternalBarcodeLookupPluginName', $externalBarcodeLookupPluginName);
|
||||
}
|
||||
}
|
||||
|
||||
public function Consume(Request $request, Response $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'consume', [
|
||||
|
Reference in New Issue
Block a user