92 words
1 minutes
aboutme
This Article is a Draft
This article is currently in a draft state and is not published. Therefore, it will not be visible to the general audience. The content is still a work in progress and may require further editing and review.
When the article is ready for publication, you can update the “draft” field to “false” in the Frontmatter:
const getUsersController = async (req, res) => {
try {
const query = await UserModel.find().select('-_id -password').exec()
return res.status(200).send(query)
} catch (err) {
return res.status(400).send({ error: err.message })
}
}
module.exports = { getUsersController }
2x
x