From 275db21740952a3bf5355998f8cf4892ee1e09ac Mon Sep 17 00:00:00 2001 From: beetle442002 Date: Sun, 8 Dec 2019 13:46:37 -0600 Subject: [PATCH] ExternalBarcodeLookup (#458) * Changed line 173 to /stock/barcodes/external-lookup/{barcode} fixes grocy/grocy#456 * Changed line 173 to /stock/barcodes/external-lookup/{barcode} fixes grocy/grocy#456 and I changed grocy.openapi.json to reflect the change --- grocy.openapi.json | 4 ++-- routes.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grocy.openapi.json b/grocy.openapi.json index 7f1af783..77036fb8 100644 --- a/grocy.openapi.json +++ b/grocy.openapi.json @@ -2119,7 +2119,7 @@ } } }, - "/stock/barcodes/external-lookup": { + "/stock/barcodes/external-lookup/{barcode}": { "get": { "summary": "Executes an external barcode lookoup via the configured plugin with the given barcode", "tags": [ @@ -2127,7 +2127,7 @@ ], "parameters": [ { - "in": "query", + "in": "path", "name": "barcode", "required": true, "description": "The barcode to lookup up", diff --git a/routes.php b/routes.php index 1fc50a7a..53541d2c 100644 --- a/routes.php +++ b/routes.php @@ -173,7 +173,7 @@ $app->group('/api', function() $this->post('/stock/products/by-barcode/{barcode}/open', '\Grocy\Controllers\StockApiController:OpenProductByBarcode'); $this->get('/stock/bookings/{bookingId}', '\Grocy\Controllers\StockApiController:StockBooking'); $this->post('/stock/bookings/{bookingId}/undo', '\Grocy\Controllers\StockApiController:UndoBooking'); - $this->get('/stock/barcodes/external-lookup', '\Grocy\Controllers\StockApiController:ExternalBarcodeLookup'); + $this->get('/stock/barcodes/external-lookup/{barcode}', '\Grocy\Controllers\StockApiController:ExternalBarcodeLookup'); } // Shopping list