import { deleteNotification } from "../../db/notifications";

export default defineEventHandler(async (event) => {
  const user = await requireUser(event);
  const id = getRouterParam(event, "id");
  if (!id) throw createError({ statusCode: 400, message: "Missing id" });

  await deleteNotification(id, user.id);
  return { ok: true };
});
