From 223fc0b6be3be57456162a34e01d7c4b9b1b8bcf Mon Sep 17 00:00:00 2001 From: jasta Date: Sun, 18 Aug 2024 10:43:57 +0900 Subject: [PATCH] fix: HttpUrl type specified --- api/birdxplorer_api/routers/data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/birdxplorer_api/routers/data.py b/api/birdxplorer_api/routers/data.py index 2959dbc..18e86a5 100644 --- a/api/birdxplorer_api/routers/data.py +++ b/api/birdxplorer_api/routers/data.py @@ -3,6 +3,7 @@ from dateutil.parser import parse as dateutil_parse from fastapi import APIRouter, HTTPException, Query, Request +from pydantic import HttpUrl from birdxplorer_common.models import ( BaseModel, @@ -124,8 +125,7 @@ def get_posts( 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}" - + post.link = HttpUrl(f"https://x.com/{post.x_user.name}/status/{post.post_id}") base_url = str(request.url).split("?")[0] next_offset = offset + limit