From 1878b2a8c79780f44dc395dd1b0125e228dc85ea Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Fri, 27 Mar 2026 09:39:51 +0100 Subject: [PATCH] fix(router): refine stock and inventory routes for improved clarity - Updated stock and inventory routes to explicitly define branchId as a required parameter, enhancing API usability and consistency in request handling. --- backend/routers/falukantRouter.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/routers/falukantRouter.js b/backend/routers/falukantRouter.js index 031d791..2482b39 100644 --- a/backend/routers/falukantRouter.js +++ b/backend/routers/falukantRouter.js @@ -22,10 +22,12 @@ router.post('/production', falukantController.createProduction); router.get('/production/:branchId', falukantController.getProduction); router.get('/stocktypes', falukantController.getStockTypes); router.get('/stockoverview', falukantController.getStockOverview); -router.get('/stock/:branchId?', falukantController.getStock); +router.get('/stock', falukantController.getStock); +router.get('/stock/:branchId', falukantController.getStock); router.post('/stock', falukantController.createStock); router.get('/products', falukantController.getProducts); -router.get('/inventory/:branchId?', falukantController.getInventory); +router.get('/inventory', falukantController.getInventory); +router.get('/inventory/:branchId', falukantController.getInventory); router.post('/sell/all', falukantController.sellAllProducts); router.post('/sell', falukantController.sellProduct); router.post('/moneyhistory', falukantController.moneyHistory);