From f1bbe2986b28bd26ea73ed54ad50e7c1138f96cf Mon Sep 17 00:00:00 2001 From: jasta Date: Sun, 18 Aug 2024 11:05:00 +0900 Subject: [PATCH] fixes the variable name --- api/birdxplorer_api/routers/data.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/api/birdxplorer_api/routers/data.py b/api/birdxplorer_api/routers/data.py index 9af0e71..92481d9 100644 --- a/api/birdxplorer_api/routers/data.py +++ b/api/birdxplorer_api/routers/data.py @@ -95,8 +95,8 @@ def get_posts( request: Request, post_id: Union[List[PostId], None] = Query(default=None), note_id: Union[List[NoteId], None] = Query(default=None), - created_at_start: Union[None, TwitterTimestamp, str] = Query(default=None), - created_at_end: Union[None, TwitterTimestamp, str] = Query(default=None), + created_at_from: Union[None, TwitterTimestamp, str] = Query(default=None), + created_at_to: Union[None, TwitterTimestamp, str] = Query(default=None), offset: int = Query(default=0, ge=0), limit: int = Query(default=100, gt=0, le=1000), search_text: Union[None, str] = Query(default=None), @@ -107,18 +107,18 @@ def get_posts( posts = list(storage.get_posts_by_ids(post_ids=post_id)) elif note_id is not None: posts = list(storage.get_posts_by_note_ids(note_ids=note_id)) - elif created_at_start is not None: - if created_at_end is not None: + elif created_at_from is not None: + if created_at_to is not None: posts = list( storage.get_posts_by_created_at_range( - start=ensure_twitter_timestamp(created_at_start), - end=ensure_twitter_timestamp(created_at_end), + start=ensure_twitter_timestamp(created_at_from), + end=ensure_twitter_timestamp(created_at_to), ) ) else: - posts = list(storage.get_posts_by_created_at_start(start=ensure_twitter_timestamp(created_at_start))) - elif created_at_end is not None: - posts = list(storage.get_posts_by_created_at_end(end=ensure_twitter_timestamp(created_at_end))) + posts = list(storage.get_posts_by_created_at_start(start=ensure_twitter_timestamp(created_at_from))) + elif created_at_to is not None: + posts = list(storage.get_posts_by_created_at_end(end=ensure_twitter_timestamp(created_at_to))) elif search_text is not None and len(search_text) > 0: posts = list(storage.search_posts_by_text(search_text)) else: