Skip to content

Conversation

DR0P-database
Copy link
Contributor

Изменения

Добавил функционал в логику GET comment

Детали реализации

Check-List

  • Вы проверили свой код перед отправкой запроса?
  • Вы написали тесты к реализованным функциям?
  • Вы не забыли применить форматирование black и isort для Back-End или Prettier для Front-End?

Copy link

💩 Code linting failed, use black and isort to fix it.

Copy link

github-actions bot commented Apr 25, 2025

Summary

Tests Skipped Failures Errors Time
50 0 💤 0 ❌ 0 🔥 11.668s ⏱️

Copy link
Contributor

@parfenovma parfenovma left a 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", # вот ключ
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А чем отличается от unreviewed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не стал переписывать unreviewd т.к возможно какаято логика завязана. Новый возвращает только pending без DISSMISED и еще чемто отлтичается

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше тогда, если уж так начал сделать, сделать явно запрос по любому статусу DISMISSED, PENDING, REVIEW

Если они не проставлены, то возвращаются все

Но, чтобы можно было вернуть, чисто по статусу одному, нужны скоупы

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

короче очень костыльно, если твоим способом

лучше так, как я предложил, но нужно это будет согласовать с фронтом


comments = query.all()
if not comments:
return CommentGetAll(polls=[], limit=limit, offset=offset, total=0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Странно что не 404

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В чем отличие если нет комментариев возвращать [] либо 404?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На что влияет и где почитать

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в целом ок 200 возвращать

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants