mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-13 15:14:49 -06:00
add unreadMessages in the response
This commit is contained in:
parent
39606240da
commit
bd94423e5b
@ -738,6 +738,7 @@ export class ChannelStartupService {
|
||||
"Chat"."name" as "pushName",
|
||||
"Chat"."createdAt" as "windowStart",
|
||||
"Chat"."createdAt" + INTERVAL '24 hours' as "windowExpires",
|
||||
"Chat"."unreadMessages" as "unreadMessages",
|
||||
CASE WHEN "Chat"."createdAt" + INTERVAL '24 hours' > NOW() THEN true ELSE false END as "windowActive",
|
||||
"Message"."id" AS lastMessageId,
|
||||
"Message"."key" AS lastMessage_key,
|
||||
@ -797,7 +798,7 @@ export class ChannelStartupService {
|
||||
windowExpires: contact.windowexpires,
|
||||
windowActive: contact.windowactive,
|
||||
lastMessage: lastMessage ? this.cleanMessageData(lastMessage) : undefined,
|
||||
unreadCount: 0,
|
||||
unreadCount: contact.unreadMessages,
|
||||
isSaved: !!contact.contactid,
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user