//===> old systemconstgetAllStudents:RequestHandler=catchAsync(async (req,res,next)=>{try{constresult=awaitStudentServices.getAllStudentsFromBD();sendResponse(res,{statusCode:httpStatus.OK,success:true,message:'getAllStudents is are retrived successgully',data:result,});}catch (err){next(err);}});//=======================================//===> new formulaconstcatchAsync=(asyncFn:RequestHandler)=>{return (req:Request,res:Response,next:NextFunction)=>{Promise.resolve(asyncFn(req,res,next)).catch((err)=>next(err));};};constgetAllStudents=catchAsync(async (req,res,next)=>{constresult=awaitStudentServices.getAllStudentsFromBD();sendResponse(res,{statusCode:httpStatus.OK,success:true,message:'getAllStudents is are retrived successgully',data:result,});});
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)