jonasschmedtmann / complete-node-bootcamp

Starter files, final projects and FAQ for my Complete Node.js Bootcamp
https://www.udemy.com/nodejs-express-mongodb-bootcamp/?couponCode=GITHUB515
3.07k stars 3.59k forks source link

Change the following mongoose line according to the new standard #196

Open hybridx opened 1 year ago

hybridx commented 1 year ago

https://github.com/jonasschmedtmann/complete-node-bootcamp/blob/d39cbf7ee6d00538ab6ff087a5b30d00ae5409ba/4-natours/after-section-11/models/reviewModel.js#L91

this.r = await this.clone().findOne()
marga0 commented 1 year ago

Can I contribute on this?

Ravindra-uk01 commented 1 month ago

In errorController.js , while doing shallow copy of err object it might happen that it does not revert back name and message field so you can add these lines also.

let error = {...err}; error.name = err.name; error.message = err.message;