Sort messages descending

- Sort messages for chats in descending
pull/5/head
Trivernis 5 years ago
parent 8f3b50a4ce
commit 9e7150645b

@ -40,7 +40,7 @@ export class ChatRoom extends Model<ChatRoom> {
public async messages({first, offset}: { first: number, offset: number }): Promise<ChatMessage[]> { public async messages({first, offset}: { first: number, offset: number }): Promise<ChatMessage[]> {
const limit = first ?? 10; const limit = first ?? 10;
offset = offset ?? 0; offset = offset ?? 0;
return await this.$get("rMessages", {limit, offset}) as ChatMessage[]; return await this.$get("rMessages", {limit, offset, order: [["id", "DESC"]]}) as ChatMessage[];
} }
/** /**

Loading…
Cancel
Save