Hello Amity,
We want to add a reply comment that belongs to only the parent comment but when we create with the snippet below they also added as a first-level comment of a post and also cannot filter out by using filterByParentId
.
await CommentRepository.createTextComment({
referenceType: 'content',
referenceId: post.id,
text: message.trim(),
parentId, // parent comment id
});
for first-level comment we also created as
await CommentRepository.createTextComment({
referenceType: 'content',
referenceId: post.id,
text: message.trim(),
});
However, we could fix this by changing the reference type to post for first-level comments as suggested in the document Posts - Amity Docs
so the first-level comment creating snippet would be
await CommentRepository.createTextComment({
referenceType: 'post',
referenceId: post.id,
text: message.trim(),
});
so after we change to the post reference type, the reply comment seems fixed but we cannot view our first-level comments in the amity console by clicking the number of comments in the comment column on the post view page which redirects to the comment view page with reference type content
by default.
anyway, we found a workaround on this, we change the reference on the top-right on the screenshot to post and copy the post id we want then we could query the post comments.
but If we use reference type content we can view comments on the amity admin panel correctly but we would have an issue with the reply comment mention above.
Please give us suggestions what is the right approach for this story.