Create routes and controller functions that fetch all users with the role of Seller

// routes/auth
router.get("/agents", auth.agents);
router.get("/agent-ad-count/:_id", auth.agentAdCount);
router.get("/agent/:username", auth.agent);

// controllers/auth
export const agents = async (req, res) => {
  try {
    const users = await User.find({ role: "Seller" }).select(
      "-password -role -enquiredProperties -wishlist -photo.ETag -photo.Key -photo.key -photo.Bucket"
    );
    res.json(users);
  } catch (err) {
    console.log(err);
  }
};

// to show how many ads one agent have
export const agentAdCount = async (req, res) => {
  try {
    const ads = await Ad.find({ postedBy: req.params._id }).select("_id");
    res.json(ads);
  } catch (err) {
    console.log(err);
  }
};

export const agent = async (req, res) => {
  try {
    const user = await User.findOne({ username: req.params.username }).select(
      "-password -role -enquiredProperties -wishlist -photo.ETag -photo.Key -photo.key -photo.Bucket"
    );
    const ads = await Ad.find({ postedBy: user._id }).select(
      "-photos.Key -photos.key -photos.ETag -photos.Bucket -location -googleMap"
    );
    res.json({ user, ads });
  } catch (err) {
    console.log(err);
  }
};