From cf0d95bcf7e123d4f29c9d2cc86d485f06bde496 Mon Sep 17 00:00:00 2001 From: kota-yata Date: Fri, 12 Apr 2024 14:51:43 +0900 Subject: [PATCH] test_notes_get passed --- birdxplorer/routers/data.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/birdxplorer/routers/data.py b/birdxplorer/routers/data.py index 5e2ad06..db9644d 100644 --- a/birdxplorer/routers/data.py +++ b/birdxplorer/routers/data.py @@ -65,11 +65,11 @@ def get_topics() -> TopicListResponse: @router.get("/notes", response_model=NoteListResponse) def get_notes( - note_ids: Union[List[NoteId], None] = Query(default=None), - created_at_from: Union[None, int, str] = Query(default=None), - created_at_to: Union[None, int, str] = Query(default=None), - topic_ids: Union[List[str], None] = Query(default=None), - post_ids: Union[List[TweetId], None] = Query(default=None), + note_ids: Union[List[NoteId], None] = Query(default=None, alias="noteIds"), + created_at_from: Union[None, int] = Query(default=None, alias="createdAtFrom"), + created_at_to: Union[None, int] = Query(default=None, alias="createdAtTo"), + topic_ids: Union[List[str], None] = Query(default=None, alias="topicIds"), + post_ids: Union[List[TweetId], None] = Query(default=None, alias="postIds"), language: Union[str, None] = Query(default=None), ) -> NoteListResponse: filters = {} @@ -77,9 +77,9 @@ def get_notes( if note_ids is not None: filters["note_ids"] = note_ids if created_at_from is not None: - filters["created_at_from"] = created_at_from + filters["created_at_from"] = TwitterTimestamp.from_int(created_at_from) if created_at_to is not None: - filters["created_at_to"] = created_at_to + filters["created_at_to"] = TwitterTimestamp.from_int(created_at_to) if topic_ids is not None: filters["topic_ids"] = topic_ids if post_ids is not None: