feat(reminders): получатели в отложенных/входящих, приватные сообщения чата, календарь, бейдж уведомлений
This commit is contained in:
@@ -267,6 +267,18 @@ export class SocialStorage extends TasksStorage {
|
||||
}
|
||||
|
||||
// User Notifications
|
||||
async getUnreadNotificationCount(userId: number, organizationId: number): Promise<number> {
|
||||
const [row] = await db
|
||||
.select({ count: sql<number>`COUNT(*)::int` })
|
||||
.from(userNotifications)
|
||||
.where(and(
|
||||
eq(userNotifications.userId, userId),
|
||||
eq(userNotifications.organizationId, organizationId),
|
||||
eq(userNotifications.isRead, false),
|
||||
));
|
||||
return row?.count ?? 0;
|
||||
}
|
||||
|
||||
async getUserNotifications(userId: number, organizationId: number, isRead?: boolean): Promise<UserNotification[]> {
|
||||
const conditions = [
|
||||
eq(userNotifications.userId, userId),
|
||||
|
||||
Reference in New Issue
Block a user