import { Router } from 'express';
import auth from '../middlewares/auth.js';
import ProductController from '../controllers/product.js'
import existance from '../middlewares/existance.js';

const ProductRouter = new Router();

ProductRouter.post('/create', auth.authenticate, existance.groupExists, auth.userIsInGroup, ProductController.create);
ProductRouter.post('/update', auth.authenticate, existance.groupExists, auth.userIsInGroup, existance.productExists, ProductController.update);

export default ProductRouter;