We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module.exports.create=async(req,res,next)=>{ const campgrounds= await campGround.findById(req.params.id) const reviewsss= new reviews(req.body.review) reviewsss.author= req.user._id campgrounds.review.push('reviewsss') console.log(campgrounds.review) await reviewsss.save() await campgrounds.save() req.flash('success','review created') res.redirect(/campground/${campgrounds._id}) }
/campground/${campgrounds._id}
The text was updated successfully, but these errors were encountered:
On line 2, you have 'campGround.findById(req.params.id)'. Maybe it's supposed to be 'Campground'?
Sorry, something went wrong.
console.log the campground and the req.body. See if they show up.
No branches or pull requests
module.exports.create=async(req,res,next)=>{
const campgrounds= await campGround.findById(req.params.id)
const reviewsss= new reviews(req.body.review)
reviewsss.author= req.user._id
campgrounds.review.push('reviewsss')
console.log(campgrounds.review)
await reviewsss.save()
await campgrounds.save()
req.flash('success','review created')
res.redirect(
/campground/${campgrounds._id}
)}
The text was updated successfully, but these errors were encountered: