mirror of
https://github.com/colanode/colanode.git
synced 2025-12-29 00:25:03 +01:00
Fix unread counts query
This commit is contained in:
@@ -163,7 +163,7 @@ export class SidebarChatListQueryHandler
|
||||
.where('n.type', '=', NodeTypes.Message)
|
||||
.where('n.parent_id', 'in', chatIds)
|
||||
.where('un.last_seen_version_id', 'is', null)
|
||||
.select(['un.node_id'])
|
||||
.select(['n.parent_id as node_id'])
|
||||
.select((eb) => [
|
||||
eb.fn.count<number>('un.node_id').as('unread_count'),
|
||||
eb.fn.sum<number>('un.mentions_count').as('mentions_count'),
|
||||
|
||||
@@ -125,7 +125,7 @@ export class SidebarSpaceListQueryHandler
|
||||
.where('n.type', '=', NodeTypes.Message)
|
||||
.where('n.parent_id', 'in', channelIds)
|
||||
.where('un.last_seen_version_id', 'is', null)
|
||||
.select(['un.node_id'])
|
||||
.select(['n.parent_id as node_id'])
|
||||
.select((eb) => [
|
||||
eb.fn.count<number>('un.node_id').as('unread_count'),
|
||||
eb.fn.sum<number>('un.mentions_count').as('mentions_count'),
|
||||
|
||||
Reference in New Issue
Block a user