7 lines
333 B
TypeScript
7 lines
333 B
TypeScript
import { db } from "@/lib/db";
|
|
|
|
export function notify(userId: number, actorId: number, postId: number, type: "comment" | "reaction", message: string) {
|
|
if (userId === actorId) return;
|
|
db.prepare("INSERT INTO notifications(user_id,actor_id,post_id,type,message) VALUES(?,?,?,?,?)").run(userId, actorId, postId, type, message);
|
|
}
|