Mark-Lasfar commited on
Commit
b9d1bc6
·
1 Parent(s): ea613b4

Add GraphQL

Browse files
Files changed (1) hide show
  1. graphql/resolvers.js +6 -2
graphql/resolvers.js CHANGED
@@ -1715,7 +1715,9 @@ post: async (parent, { id }, context) => {
1715
  profile: { nickname: 'Unknown', avatar: '/assets/img/default-avatar.png', jobTitle: '' }
1716
  },
1717
  likesCount: r.likes?.length || 0,
1718
- isLiked: r.likes?.some(l => l.userId?.toString() === context.user?.userId) || false
 
 
1719
  };
1720
  });
1721
 
@@ -1728,7 +1730,9 @@ post: async (parent, { id }, context) => {
1728
  },
1729
  likesCount: c.likes?.length || 0,
1730
  isLiked: c.likes?.some(l => l.userId?.toString() === context.user?.userId) || false,
1731
- replies: replies
 
 
1732
  };
1733
  });
1734
  }
 
1715
  profile: { nickname: 'Unknown', avatar: '/assets/img/default-avatar.png', jobTitle: '' }
1716
  },
1717
  likesCount: r.likes?.length || 0,
1718
+ isLiked: r.likes?.some(l => l.userId?.toString() === context.user?.userId) || false,
1719
+ isEdited: r.isEdited || false,
1720
+ edited: r.edited || false
1721
  };
1722
  });
1723
 
 
1730
  },
1731
  likesCount: c.likes?.length || 0,
1732
  isLiked: c.likes?.some(l => l.userId?.toString() === context.user?.userId) || false,
1733
+ replies: replies,
1734
+ isEdited: c.isEdited || false,
1735
+ edited: c.edited || false
1736
  };
1737
  });
1738
  }