const router = require('express').Router();
const { authMiddleware } = require('../middleware/auth');
const c = require('../controllers/biochemController');

router.use(authMiddleware);

router.get('/elements',               c.getElements);
router.get('/molecules',              c.getMolecules);
router.get('/molecules/:id',          c.getMolecule);
router.post('/validate',              c.validate);
router.get('/reactions',              c.getReactions);
router.get('/challenges',             c.getChallenges);
router.post('/challenges/:id/solve',  c.solveChallenge);
router.get('/saved',                  c.getSaved);
router.post('/saved',                 c.saveMolecule);
router.delete('/saved/:id',           c.deleteSaved);

module.exports = router;
