List comments by post

This commit is contained in:
simonwt 2026-03-31 12:10:15 +01:00
parent 620553ea14
commit d889fdff20
3 changed files with 33 additions and 17 deletions

View file

@ -1 +1,2 @@
from .create import create
from .create import create
from .listtbypostid import listtbypostid

View file

@ -0,0 +1,12 @@
def listtbypostid(API, post_id: str,) -> dict:
"""
Fetches the list of comments for a given post ID from the API.
Args:
post_id (str): ID of the post to fetch comments for.
Returns:
dict: The list of comments for the post.
"""
print(f"Fetching comments for post ID: {post_id}")
comment_list = API.make_request("GET", "content", f"comment/bypostid/{post_id}", authenticate=True)
return comment_list