UI: Agregar iconos a expandir/colapsar y notificacion al copiar
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
This commit is contained in:
@@ -29,10 +29,11 @@ export default defineEventHandler(async (event) => {
|
||||
throw createError({ statusCode: 404, message: 'Instance not found' })
|
||||
}
|
||||
|
||||
// Get chats with last message
|
||||
// Get chats with last message and type
|
||||
const result = await query<ChatRow>(
|
||||
`SELECT c.id, c.jid, c.name, c.is_group, c.unread_count, c.last_message_at,
|
||||
(SELECT content FROM messages m WHERE m.chat_id = c.id ORDER BY timestamp DESC LIMIT 1) as last_message
|
||||
c.last_message_type,
|
||||
(SELECT COALESCE(content, caption) FROM messages m WHERE m.chat_id = c.id ORDER BY timestamp DESC LIMIT 1) as last_message
|
||||
FROM chats c
|
||||
WHERE c.instance_id = $1
|
||||
ORDER BY c.last_message_at DESC NULLS LAST`,
|
||||
@@ -46,6 +47,7 @@ export default defineEventHandler(async (event) => {
|
||||
isGroup: row.is_group,
|
||||
unreadCount: row.unread_count,
|
||||
lastMessageAt: row.last_message_at,
|
||||
lastMessage: row.last_message || ''
|
||||
lastMessage: row.last_message || '',
|
||||
lastMessageType: row.last_message_type || 'text'
|
||||
}))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user