import { Router } from "express";

import { usersController } from "../controllers/usersController.js";
import { asyncHandler } from "../utils/asyncHandler.js";

const router = Router();

router.post("/push-token", asyncHandler(usersController.registerPushToken));
router.get("/", asyncHandler(usersController.list));
router.get("/:id", asyncHandler(usersController.getById));
router.post("/", asyncHandler(usersController.create));
router.put("/:id", asyncHandler(usersController.update));
router.put("/:id/modules", asyncHandler(usersController.updateModules));
router.delete("/:id", asyncHandler(usersController.remove));

export default router;
