added endpoints for retreiving info about items
This commit is contained in:
		@@ -14,5 +14,7 @@ const AbstractProductRouter = new Router();
 | 
			
		||||
 | 
			
		||||
AbstractProductRouter.post('/create', upload.single("file"), tryHandler(auth.authenticate), tryHandler(auth.userIsInGroup), tryHandler(AbstractProductController.create));
 | 
			
		||||
AbstractProductRouter.post('/update', upload.single("file"), tryHandler(auth.authenticate), tryHandler(auth.userIsInGroup), tryHandler(existance.localIdExists), tryHandler(AbstractProductController.update));
 | 
			
		||||
AbstractProductRouter.get('/:groupId/:localId', tryHandler(auth.authenticate), tryHandler(auth.userIsInGroup), tryHandler(existance.localIdExists), tryHandler(AbstractProductController.getById));
 | 
			
		||||
AbstractProductRouter.get('/getimage/:groupId/:localId', tryHandler(auth.authenticate), tryHandler(auth.userIsInGroup), tryHandler(existance.localIdExists), tryHandler(AbstractProductController.getImage));
 | 
			
		||||
 | 
			
		||||
export default AbstractProductRouter;
 | 
			
		||||
@@ -6,7 +6,8 @@ import existance from '../middlewares/existance.js';
 | 
			
		||||
 | 
			
		||||
const CategoryRouter = new Router();
 | 
			
		||||
 | 
			
		||||
CategoryRouter.post('/create', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(CategoryController.create));
 | 
			
		||||
CategoryRouter.post('/update', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(existance.localIdExists), tryHandler(CategoryController.update));
 | 
			
		||||
CategoryRouter.post('/create', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(auth.userIsInGroup), tryHandler(CategoryController.create));
 | 
			
		||||
CategoryRouter.post('/update', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(auth.userIsInGroup), tryHandler(existance.localIdExists), tryHandler(CategoryController.update));
 | 
			
		||||
CategoryRouter.get('/:groupId/:localId', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(auth.userIsInGroup), tryHandler(existance.localIdExists), tryHandler(CategoryController.getByLocalId))
 | 
			
		||||
 | 
			
		||||
export default CategoryRouter;
 | 
			
		||||
@@ -8,5 +8,6 @@ const ProductRouter = new Router();
 | 
			
		||||
 | 
			
		||||
ProductRouter.post('/create', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(auth.userIsInGroup), tryHandler(ProductController.create));
 | 
			
		||||
ProductRouter.post('/update', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(existance.localIdExists), tryHandler(auth.userIsInGroup), tryHandler(ProductController.update));
 | 
			
		||||
ProductRouter.get('/:groupId/:localId', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(existance.localIdExists), tryHandler(auth.userIsInGroup), tryHandler(ProductController.getByLocalId))
 | 
			
		||||
 | 
			
		||||
export default ProductRouter;
 | 
			
		||||
		Reference in New Issue
	
	Block a user