const {authJwt} = require("../middlewares");
module.exports = app => {
    const centerPhone = require("../controllers/center-phone.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 Phones
    router.get("/", [authJwt.verifyToken], centerPhone.getAllCenterPhones);
    // Create a new Phone
    router.post("/", [authJwt.verifyToken], centerPhone.createCenterPhone);
    router.get('/:id', [authJwt.verifyToken], centerPhone.getCenterPhone);
    router.put('/:id', [authJwt.verifyToken], centerPhone.updateCenterPhone);
    app.use('/api/phones', router);
 };