Merge pull request #971 from jesus-chacon/bugs/fix_fetch_chats_query

Fix fetch chats query
This commit is contained in:
Davidson Gomes 2024-10-11 10:56:07 -03:00 committed by GitHub
commit f5baced024
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;
`; `;
} }