mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-08-28 18:26:12 -06:00
Corrige filtro de mensagens com OR dinâmico para conseguir filtrar por remoteJid ou senderPn
This commit is contained in:
parent
39606240da
commit
10f153a951
@ -4480,6 +4480,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
id?: string;
|
||||
fromMe?: boolean;
|
||||
remoteJid?: string;
|
||||
senderPn?: string;
|
||||
participants?: string;
|
||||
};
|
||||
|
||||
@ -4503,9 +4504,12 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
AND: [
|
||||
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
||||
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
||||
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
||||
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 } } : {},
|
||||
]
|
||||
},
|
||||
});
|
||||
|
||||
@ -4527,9 +4531,12 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
AND: [
|
||||
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
|
||||
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
|
||||
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
|
||||
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 } } : {},
|
||||
]
|
||||
},
|
||||
orderBy: { messageTimestamp: 'desc' },
|
||||
skip: query.offset * (query?.page === 1 ? 0 : (query?.page as number) - 1),
|
||||
|
Loading…
Reference in New Issue
Block a user