Fix error in query for last N channel messages

This commit is contained in:
Max Brunsfeld 2023-10-06 10:58:34 -07:00
parent c46137e40d
commit 663649a100
2 changed files with 68 additions and 2 deletions

View file

@ -89,7 +89,7 @@ impl Database {
let mut rows = channel_message::Entity::find()
.filter(condition)
.order_by_asc(channel_message::Column::Id)
.order_by_desc(channel_message::Column::Id)
.limit(count as u64)
.stream(&*tx)
.await?;
@ -110,6 +110,7 @@ impl Database {
});
}
drop(rows);
messages.reverse();
Ok(messages)
})
.await