Explorar el Código

added in actionFidSubComment get likes owner _id

makstravm hace 2 años
padre
commit
743e9eb279
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 1 1
      src/actions/index.js
  2. 2 1
      src/components/main/post/PostComment.js

+ 1 - 1
src/actions/index.js

@@ -340,7 +340,7 @@ export const actionFindSubComment = (findId) =>
                 post {_id }
                 answers { _id}
                 createdAt
-                likes { _id owner { login nick } }
+                likes { _id owner { _id login nick } }
                 owner {
                     _id login nick 
                     avatar { url } 

+ 2 - 1
src/components/main/post/PostComment.js

@@ -58,8 +58,9 @@ export const PostCommentDate = ({ createdAt }) =>
 
 const PostCommentAction = ({ myID, commentId, likes, delLikeComment, addLikeComment }) => {
     const [open, setOpen] = useState(false);
+    debugger
     const likeId = likes.find(l => l?.owner?._id === myID)?._id
-
+    console.log(likeId)
     const changeLike = () => likeId ? delLikeComment(likeId, commentId) : addLikeComment(commentId)
 
     return (