mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-08-29 02:36:11 -06:00
Corrige filtro de mensagens com OR dinâmico para conseguir filtrar por remoteJid ou senderPn
This commit is contained in:
parent
10f153a951
commit
4dafa46b7b
@ -4505,11 +4505,13 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
||||||
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
||||||
keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
|
keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
|
||||||
|
{
|
||||||
|
OR: [
|
||||||
|
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
||||||
|
keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {},
|
||||||
|
]
|
||||||
|
}
|
||||||
],
|
],
|
||||||
OR: [
|
|
||||||
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
|
||||||
keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -4532,11 +4534,14 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
||||||
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
||||||
keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
|
keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
|
||||||
|
{
|
||||||
|
OR: [
|
||||||
|
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
||||||
|
keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {},
|
||||||
|
]
|
||||||
|
}
|
||||||
],
|
],
|
||||||
OR: [
|
|
||||||
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
|
||||||
keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
orderBy: { messageTimestamp: 'desc' },
|
orderBy: { messageTimestamp: 'desc' },
|
||||||
skip: query.offset * (query?.page === 1 ? 0 : (query?.page as number) - 1),
|
skip: query.offset * (query?.page === 1 ? 0 : (query?.page as number) - 1),
|
||||||
|
Loading…
Reference in New Issue
Block a user