chore:linting,formatting,type fixing, ....

This commit is contained in:
2025-11-08 14:39:33 +01:00
parent 0754d62d0e
commit ae339d68e1
17 changed files with 86 additions and 74 deletions

View File

@@ -4,7 +4,11 @@ import type { NotificationInsert } from './db/schema';
import { eq, and, desc } from 'drizzle-orm';
import { nanoid } from 'nanoid';
export type NotificationType = 'friend_request' | 'friend_accepted' | 'find_liked' | 'find_commented';
export type NotificationType =
| 'friend_request'
| 'friend_accepted'
| 'find_liked'
| 'find_commented';
export interface CreateNotificationData {
userId: string;
@@ -106,10 +110,7 @@ export class NotificationService {
*/
async markAsRead(notificationIds: string[]): Promise<void> {
for (const id of notificationIds) {
await db
.update(notification)
.set({ isRead: true })
.where(eq(notification.id, id));
await db.update(notification).set({ isRead: true }).where(eq(notification.id, id));
}
}
@@ -117,20 +118,14 @@ export class NotificationService {
* Mark a single notification as read
*/
async markOneAsRead(notificationId: string): Promise<void> {
await db
.update(notification)
.set({ isRead: true })
.where(eq(notification.id, notificationId));
await db.update(notification).set({ isRead: true }).where(eq(notification.id, notificationId));
}
/**
* Mark all notifications as read for a user
*/
async markAllAsRead(userId: string): Promise<void> {
await db
.update(notification)
.set({ isRead: true })
.where(eq(notification.userId, userId));
await db.update(notification).set({ isRead: true }).where(eq(notification.userId, userId));
}
/**