-
Notifications
You must be signed in to change notification settings - Fork 2
Develop alert bot #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Develop alert bot #123
Conversation
💩 Code linting failed, use |
Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кмк лучше отдельную ручку под бота сделать)
user_id: int | None = None, | ||
order_by: list[Literal["create_ts"]] = Query(default=[]), | ||
unreviewed: bool = False, | ||
review_mode: Literal["all", "pending"] = "all", # вот ключ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А чем отличается от unreviewed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не стал переписывать unreviewd т.к возможно какаято логика завязана. Новый возвращает только pending без DISSMISED и еще чемто отлтичается
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше тогда, если уж так начал сделать, сделать явно запрос по любому статусу DISMISSED, PENDING, REVIEW
Если они не проставлены, то возвращаются все
Но, чтобы можно было вернуть, чисто по статусу одному, нужны скоупы
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
короче очень костыльно, если твоим способом
лучше так, как я предложил, но нужно это будет согласовать с фронтом
rating_api/routes/comment.py
Outdated
|
||
comments = query.all() | ||
if not comments: | ||
return CommentGetAll(polls=[], limit=limit, offset=offset, total=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Странно что не 404
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В чем отличие если нет комментариев возвращать [] либо 404?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
На что влияет и где почитать
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в целом ок 200 возвращать
Изменения
Добавил функционал в логику GET comment
Детали реализации
Check-List
black
иisort
для Back-End илиPrettier
для Front-End?