Skip to main content

How to restrict members to a single comment per channel while enabling comment data export via API?

Is there a way to limit a member to 1 comment per comment channel?

4 comments

  • Duncan from Memberstack
    Duncan from Memberstack

    Hey John 👋 Not possible natively, but you can do it with javascript. You could save the comment count + page slug to the member's JSON. If they have 1+ comment then you can disable the form submission

    https://rey.memberstack.com/ can help you write the code

    0
  • John Ramos
    John Ramos OP

    Sweet, thanks Duncan!

    0
  • John Ramos
    John Ramos OP

    Is there a way to export comment data through the API?

    0
  • Raquel  Lopez
    Raquel Lopez

    It's not documented yet, but you can fetch the comments information using the memberstackDom library in the frontend. You can use the getPosts() method

    $memberstackDom.getPosts({
    channelKey: string
    order?: "newest" | "oldest"
    after?: string
    limit?: number
    })
    0

Please sign in to leave a comment.

Sitemap