File size: 340 Bytes
8a6248c
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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});
    }
}