Skip to content

Commit

Permalink
Conversations: fix list conversations (#223)
Browse files Browse the repository at this point in the history
* Conversations: fix list conversations

* fix test

* remove print
  • Loading branch information
lusmoura authored Jun 17, 2024
1 parent 6109c61 commit 3bd75b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/backend/crud/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def get_conversations(
return (
db.query(Conversation)
.filter(Conversation.user_id == user_id)
.order_by(Conversation.updated_at.desc())
.offset(offset)
.limit(limit)
.all()
Expand Down
2 changes: 1 addition & 1 deletion src/backend/tests/crud/test_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_list_conversations_empty(session, user):
def test_list_conversations_with_pagination(session, user):
for i in range(10):
get_factory("Conversation", session).create(
title=f"Conversation {i}", user_id=user.id
title=f"Conversation {i}", user_id=user.id, updated_at=f"2021-01-{31-i}"
)

conversations = conversation_crud.get_conversations(
Expand Down

0 comments on commit 3bd75b0

Please sign in to comment.