producthunt / producthunt-api

Product Hunt API
311 stars 28 forks source link

Weird comments pagination problem #111

Closed a-sabaa closed 7 years ago

a-sabaa commented 7 years ago

So for example when I try to use this URL to get some comments: https://api.producthunt.com/v1/comments?search[post_id]=84778 I get 7 comments (by the time of this post). But if I try to use the latest one (has ID 400469 and parent_comment_id to be null) as a reference point to test older/newer pagination and try this API endpoint https://api.producthunt.com/v1/comments?search[post_id]=84778&older=400469 I get an empty comments which doesn't make much sense, even if I try to use the ID of a random comment in the middle to try and see older/newer comments, I always get an empty result.

andreasklinger commented 7 years ago

i have a few similar reports - so i might be answering here incorrectly while still working on the actual bug

are you sure there are older comments than this id connected to the post?

this works eg https://api.producthunt.com/v1/comments?search[post_id]=84778&older=399629

parent_comment_id is irrelevant for this endpoint - if you want threaded returns look for the threads endpoint (but imho just use the one here and thread yourself)

andreasklinger commented 7 years ago

This should work now again - please verify and reopen in case it is not working as you expect it to