import express from 'express';
import * as controller from '../controllers/product-group.controller';
import { createAuthMiddleware } from '../auth';
import { MODERATOR } from '../auth/constants';

const router = express.Router();

router.use(createAuthMiddleware(MODERATOR));
router.get('/', controller.list);
router.post('/', controller.create);
router.put('/:id', controller.update);
router.delete('/:id', controller.destroy);

export default router;

@@ -161,16 +161,23 @@
 ODERATOR
+, TOKEN
  %7D from 
@@ -243,12 +243,17 @@
 ter.
-use(
+get('/', 
 crea
@@ -273,35 +273,14 @@
 are(
-MODERATOR));%0Arouter.get('/'
+TOKEN)
 , co
@@ -311,16 +311,49 @@
 ost('/',
+ createAuthMiddleware(MODERATOR),
  control
@@ -375,32 +375,65 @@
 uter.put('/:id',
+ createAuthMiddleware(MODERATOR),
  controller.upda
@@ -458,16 +458,49 @@
 ('/:id',
+ createAuthMiddleware(MODERATOR),
  control

Change product group api authentication