Fix fetch chats query

This commit is contained in:
Jesus 2024-10-11 08:19:51 +02:00
parent f38f3e5ba5
commit 8ab8961e91

View File

@ -662,9 +662,8 @@ export class ChannelStartupService {
GROUP BY GROUP BY
"Chat"."id", "Chat"."id",
"Chat"."remoteJid", "Chat"."remoteJid",
"Contact"."id", "Contact"."id"
"Message"."messageTimestamp" ORDER BY last_message_messageTimestamp DESC NULLS LAST, "Chat"."updatedAt" DESC;
ORDER BY "Message"."messageTimestamp" DESC NULLS LAST, "Chat"."updatedAt" DESC;
`; `;
} else { } else {
results = await this.prismaRepository.$queryRaw` results = await this.prismaRepository.$queryRaw`
@ -698,9 +697,8 @@ export class ChannelStartupService {
GROUP BY GROUP BY
"Chat"."id", "Chat"."id",
"Chat"."remoteJid", "Chat"."remoteJid",
"Contact"."id", "Contact"."id"
"Message"."messageTimestamp" ORDER BY last_message_messageTimestamp DESC NULLS LAST, "Chat"."updatedAt" DESC;
ORDER BY "Message"."messageTimestamp" DESC NULLS LAST, "Chat"."updatedAt" DESC;
`; `;
} }