const {authJwt} = require("../middlewares");
module.exports = app => {
    const attendanceNotes = require("../controllers/attendance-note.controller.js");
    app.use((req, res, next) => {
      res.header(
        "Access-Control-Allow-Headers",
        "x-access-token, Origin, Content-Type, Accept"
      );
      next();
    });
    var router = require("express").Router();
    
    // Retrieve all attendance notes
    router.get("/", [authJwt.verifyToken], attendanceNotes.getAllAttendanceNotes);
    
    // Create a new attendance note
    router.post("/", [authJwt.verifyToken], attendanceNotes.createNewAttendanceNote);
    
    // Get one attendance note by id
    router.get('/:id', [authJwt.verifyToken], attendanceNotes.getAttendanceNote);
    
    // Update an attendance note
    router.put('/:id', [authJwt.verifyToken], attendanceNotes.updateAttendanceNote);
    
    // Delete an attendance note
    router.delete('/:id', [authJwt.verifyToken], attendanceNotes.deleteAttendanceNote);
    
    app.use('/api/attendance-notes', router);
 }; 