kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
at main 22 lines 561 B view raw
1import { 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) { 7 const [notification] = await db 8 .update(notificationTable) 9 .set({ isRead: true }) 10 .where(eq(notificationTable.id, id)) 11 .returning(); 12 13 if (!notification) { 14 throw new HTTPException(404, { 15 message: "Notification not found", 16 }); 17 } 18 19 return notification; 20} 21 22export default markNotificationAsRead;