Explorar o código

added in actionFidSubComment get likes owner _id

makstravm %!s(int64=2) %!d(string=hai) anos
pai
achega
743e9eb279
Modificáronse 2 ficheiros con 3 adicións e 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 (