const express = require("express");
const { UserController } = require("../../controllers/api");
const { verifyToken } = require("../../middleware");
const { upload } = require("../../helpers");
const { UserValidation } = require("../../validations/UserValidation");
const router = express.Router();

router.get("/", verifyToken, UserController.index);
router.get(
  "/getUserPropertyCount",
  verifyToken,
  UserController.getPropertyCount
);
router.put(
  "/",
  upload.fields([
    { name: "image", maxCount: 1 },
    { name: "coverImage", maxCount: 1 },
  ]),
  verifyToken,
  UserValidation,
  UserController.updateProfile
);

module.exports = router;
