Agromind-backend / backend /controllers /getExpertsController.js
gh-action-hf-auto
auto: sync backend from github@32fb9685
8a6248c
import User from '../models/auth.model.js'
// controller to get all expert user
export const getExperts = async(req, res)=>{
try{
const experts = await User.find({role: 'expert'});
res.status(200).json(experts);
}catch(err){
res.status(500).json({message : "Failed to fetch the user details", err});
}
}