mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-13 15:14:49 -06:00
fetchContacts - nestordavalos
This commit is contained in:
parent
3ab75faff7
commit
eeedfb0e2a
@ -513,7 +513,20 @@ export class ChannelStartupService {
|
||||
contactFindManyArgs.skip = query.offset * (validPage - 1);
|
||||
}
|
||||
|
||||
return await this.prismaRepository.contact.findMany(contactFindManyArgs);
|
||||
const contacts = await this.prismaRepository.contact.findMany(contactFindManyArgs);
|
||||
|
||||
return contacts.map((contact) => {
|
||||
const remoteJid = contact.remoteJid;
|
||||
const isGroup = remoteJid.endsWith('@g.us');
|
||||
const isSaved = !!contact.pushName || !!contact.profilePicUrl;
|
||||
const type = isGroup ? 'group' : isSaved ? 'contact' : 'group_member';
|
||||
return {
|
||||
...contact,
|
||||
isGroup,
|
||||
isSaved,
|
||||
type,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public cleanMessageData(message: any) {
|
||||
|
Loading…
Reference in New Issue
Block a user