done refactoring User controller + UserModel

This commit is contained in:
Kfir Dayan 2023-06-21 14:54:32 +03:00
parent 766b52dce1
commit f3d506c005

View file

@ -42,7 +42,7 @@ app.use('/cart', cartRouter);
app.all('*', (req, res, next) => { app.all('*', (req, res, next) => {
// res.status(404).json({ error: 'Route not found' }); // res.status(404).json({ error: 'Route not found' });
const error = new ApiError('Route not found'); const error = new ApiError('Are you lost?');
error.statusCode = 404; error.statusCode = 404;
error.status = 'fail'; error.status = 'fail';
next(error) next(error)