Fix: order createdAt_desc & lastMessageAt_desc

This commit is contained in:
elweyn 2023-07-20 14:31:57 +02:00
parent 21124bcd71
commit 074711dd90
2 changed files with 2 additions and 2 deletions

View File

@ -257,7 +257,7 @@ export default {
const rmsIds = [] const rmsIds = []
;[...Room, ...this.rooms].forEach((r) => { ;[...Room, ...this.rooms].forEach((r) => {
if (!rmsIds.find((v) => v === r.id)) { if (!rmsIds.find((v) => v === r.id)) {
rms.unshift(this.fixRoomObject(r)) rms.push(this.fixRoomObject(r))
rmsIds.push(r.id) rmsIds.push(r.id)
} }
}) })

View File

@ -24,7 +24,7 @@ export const createRoom = () => gql`
export const roomQuery = () => gql` export const roomQuery = () => gql`
query Room($first: Int, $offset: Int, $id: ID) { query Room($first: Int, $offset: Int, $id: ID) {
Room(first: $first, offset: $offset, id: $id, orderBy: [lastMessageAt_desc, createdAt_desc]) { Room(first: $first, offset: $offset, id: $id, orderBy: [createdAt_desc, lastMessageAt_desc]) {
id id
roomId roomId
roomName roomName