Skip to content
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

Order chat by date #436

Merged
merged 2 commits into from
May 22, 2024
Merged

Order chat by date #436

merged 2 commits into from
May 22, 2024

Conversation

252afh
Copy link
Contributor

@252afh 252afh commented May 22, 2024

Context

Chat messages are currently not ordered

Changes proposed in this pull request

  • Added an order_by("created_at") to messages

Guidance to review

  • Start a new chat and send a load of messages, then refresh the page, the order should remain

Relevant links

Things to check

  • I have added any new ENV vars in all deployed environments
  • I have tested any code added or changed
  • I have run integration tests

django_app/redbox_app/redbox_core/views.py Outdated Show resolved Hide resolved
@@ -176,7 +177,7 @@ def chats_view(request: HttpRequest, chat_id: uuid = None):

messages = []
if chat_id:
messages = ChatMessage.objects.filter(chat_history__id=chat_id)
messages = ChatMessage.objects.filter(chat_history__id=chat_id).order_by("created_at")
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@252afh 252afh merged commit ca3b4ec into main May 22, 2024
8 of 9 checks passed
@252afh 252afh deleted the bugfix/order-chat-by-date branch May 22, 2024 13:43
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.

2 participants