mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-26 15:17:44 -06:00
feature: add endpoint to retrieve chat data by phone number
This commit is contained in:
@@ -696,6 +696,16 @@ export class ChannelStartupService {
|
||||
});
|
||||
}
|
||||
|
||||
public async findChatByRemoteJid(remoteJid: string) {
|
||||
if (!remoteJid) return null;
|
||||
return await this.prismaRepository.chat.findFirst({
|
||||
where: {
|
||||
instanceId: this.instanceId,
|
||||
remoteJid: remoteJid,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public async fetchChats(query: any) {
|
||||
const remoteJid = query?.where?.remoteJid
|
||||
? query?.where?.remoteJid.includes('@')
|
||||
|
||||
Reference in New Issue
Block a user