diff --git a/api/birdxplorer_api/routers/data.py b/api/birdxplorer_api/routers/data.py index 57d216e..4900401 100644 --- a/api/birdxplorer_api/routers/data.py +++ b/api/birdxplorer_api/routers/data.py @@ -124,6 +124,11 @@ def get_posts( search_text=search_text, ) + total_count = len(posts) + paginated_posts = posts[offset : offset + limit] + for post in paginated_posts: + post.link = f"https://x.com/{post.x_user.name}/status/{post.post_id}" + base_url = str(request.url).split("?")[0] next_offset = offset + limit prev_offset = max(offset - limit, 0) diff --git a/common/birdxplorer_common/models.py b/common/birdxplorer_common/models.py index 7e3ab8e..5b74fdd 100644 --- a/common/birdxplorer_common/models.py +++ b/common/birdxplorer_common/models.py @@ -678,6 +678,7 @@ class XUser(BaseModel): class Post(BaseModel): + link: HttpUrl post_id: PostId x_user_id: UserId x_user: XUser