kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 9a620ba2f31238f03cd28f1da5ef3838d67e4e8a 24 lines 638 B view raw
1import { and, eq } from "drizzle-orm"; 2import { HTTPException } from "hono/http-exception"; 3import db from "../../database"; 4import { notificationTable } from "../../database/schema"; 5 6async function markNotificationAsRead(id: string, userId: string) { 7 const [notification] = await db 8 .update(notificationTable) 9 .set({ isRead: true }) 10 .where( 11 and(eq(notificationTable.id, id), eq(notificationTable.userId, userId)), 12 ) 13 .returning(); 14 15 if (!notification) { 16 throw new HTTPException(404, { 17 message: "Notification not found", 18 }); 19 } 20 21 return notification; 22} 23 24export default markNotificationAsRead;