Fix messages query (#46)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2025-04-21 21:27:55 +04:00
committed by GitHub
parent e6543090e5
commit 28355ea25a
7 changed files with 46 additions and 26 deletions
+3 -3
View File
@@ -17,7 +17,6 @@ import { type LiveQueries } from '@hcengineering/communication-query'
import type { PagedQueryCallback, QueryCallback } from '@hcengineering/communication-sdk-types'
import {
type FindLabelsParams,
type FindMessagesParams,
type FindNotificationContextParams,
type FindNotificationsParams,
type Label,
@@ -26,6 +25,7 @@ import {
type Notification
} from '@hcengineering/communication-types'
import { deepEqual } from 'fast-equals'
import type { MessageQueryParams } from '@hcengineering/communication-query'
class BaseQuery<P extends Record<string, any>, C extends (r: any) => void> {
private oldQuery: P | undefined
@@ -78,8 +78,8 @@ class BaseQuery<P extends Record<string, any>, C extends (r: any) => void> {
}
}
export class MessagesQuery extends BaseQuery<FindMessagesParams, PagedQueryCallback<Message>> {
override createQuery(params: FindMessagesParams, callback: PagedQueryCallback<Message>): { unsubscribe: () => void } {
export class MessagesQuery extends BaseQuery<MessageQueryParams, PagedQueryCallback<Message>> {
override createQuery(params: MessageQueryParams, callback: PagedQueryCallback<Message>): { unsubscribe: () => void } {
return this.lq.queryMessages(params, callback)
}
}