Skip to content

Commit

Permalink
Update delete
Browse files Browse the repository at this point in the history
Story.remove method has been deprecated, replaced with Story.deleteOne
  • Loading branch information
Peterjyc committed Mar 28, 2023
1 parent f4bd44c commit ce23cca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routes/stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ router.delete('/:id', ensureAuth, async (req, res) => {
if (story.user != req.user.id) {
res.redirect('/stories')
} else {
await Story.remove({ _id: req.params.id })
await Story.deleteOne({ _id: req.params.id })
res.redirect('/dashboard')
}
} catch (err) {
Expand Down

0 comments on commit ce23cca

Please sign in to comment.