feat : ask for noti
CI / Verify (push) Successful in 1m50s
CI / Build immutable images and deploy (push) Successful in 2m59s

This commit is contained in:
2026-10-08 02:23:59 +07:00 Unverified
parent 5812d99715
commit 9bc710c94b
34 changed files with 10913 additions and 201 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { after } from "next/server";
import { sendCommentReplyPush } from "@/lib/comments/push";
import { sendCommentPush } from "@/lib/comments/push";
import { getCommentViewer, listComments, requireCommentViewer } from "@/lib/comments/repository";
import { publishComment } from "@/lib/comments/publish";
import { errorResponse, HttpError, requireSameOrigin } from "@/lib/security/http";
@@ -21,7 +21,7 @@ export async function POST(request: Request) {
const target = new URL(request.url).searchParams.get("target");
if (!target) throw new HttpError(400, "target-required");
const result = await publishComment(request, viewer, { target });
after(async () => { await sendCommentReplyPush(result.id).catch(() => console.error("Comment reply notification failed")); });
after(async () => { await sendCommentPush(result.id).catch(() => console.error("Comment notification failed")); });
return Response.json(result, { status: 201 });
} catch (cause) { return errorResponse(cause); }
}