{"size": 535, "ext": "js", "max_stars_repo_path": "src/routes/users.js", "max_stars_repo_name": "maiconandsilva/vaccine-control-api", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/routes/users.js", "max_issues_repo_name": "maiconandsilva/vaccine-control-api", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/routes/users.js", "max_forks_repo_name": "maiconandsilva/vaccine-control-api", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.7222222222, "max_line_length": 75, "alphanum_fraction": 0.7738317757}
const express = require("express");
const { usersController } = require("../controllers");
const models = require("../models");
const authMiddleware = require("../middlewares/authorization");

const usersRouter = express.Router();

usersRouter.use(
  authMiddleware.requireAuthentication,
  authMiddleware.loadUserFromToken,
  authMiddleware.verifyUserAuthorization(models.User.USER_TYPE_ENUM.ADMIN),
);

usersRouter.get("/", usersController.getAll);
usersRouter.post("/update", usersController.update);

module.exports = usersRouter;
