Skip to content

Commit

Permalink
changed delete friend method in routes to findOneAndUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
chelcie de almeida authored and chelcie de almeida committed Jun 16, 2021
1 parent 50a4e82 commit f7ed1ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/user-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const userController = {
},

deleteFriend({ params }, res) {
User.findOneAndDelete(
User.findOneAndUpdate(
{_id: params.userId},
{ $pull: { friends: params.friendId} },
{ new: true, runValidators: true}
Expand Down

0 comments on commit f7ed1ef

Please sign in to comment.