Skip to content

Commit

Permalink
Mesto Russia (sprint 16): fix after 2 review
Browse files Browse the repository at this point in the history
  • Loading branch information
MalakhN committed May 18, 2023
1 parent bbf8b10 commit d219ed3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 121 deletions.
116 changes: 0 additions & 116 deletions 111111.js

This file was deleted.

8 changes: 3 additions & 5 deletions backend/controllers/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ const deleteCard = (req, res, next) => {
};

const likeCard = (req, res, next) => {
const { cardId } = req.params;
const owner = req.user._id;
Card.findByIdAndUpdate(
cardId,
{ $addToSet: { likes: owner } },
{ new: true },
req.params.cardId,
{ $addToSet: { likes: req.user._id } },
{ new: true }
)
.populate(['owner', 'likes'])
.then((card) => {
Expand Down

0 comments on commit d219ed3

Please sign in to comment.