Using predefined postId to create post

Hello,

The problem we are facing now is we have existing articles ( posts ) and need to built comment features around them using eko-sdk comment model. So we have to tie our existing articleId to amity post model in somehow and able to retrieve comments related to our articleId back.

Would this be possible? Or Do you have solutions to this kind of problem ?

Thank you

1 Like

Hello Jing,

For this, you can use the comment model and passing “content” as “targetType”. When doing so, you can pass any “targetId” of your choice, which means you can use this to pass your own articleId.

After that, you can use the set pair of parameters to query your comments back.

Let me know it that helped!

Julien

1 Like

Thank you @Julien for the reply,

We tried on this solution before but faced another problem of getting the total count number of comments which is from document, It could get from the post model so we tried to get the post model by the referenceId ( in our case articleId ) but getting error like this comment How to get total comments related to a reference ID? - #5 by jing

Please suggest me if something I tried is not correct or any solution

Thank you again.
Jing

1 Like

Hi @jing,

I’ve replied in the post you mentioned. Issue should be resolved starting from 5.1.0 :slight_smile:

Let me know if you have any more problems.

1 Like