feat : copy youtube studio
CI / Verify (push) Successful in 2m8s
CI / Build immutable images and deploy (push) Successful in 2m39s

This commit is contained in:
2026-10-08 03:26:00 +07:00 Unverified
parent 9bc710c94b
commit b665fe7497
16 changed files with 196 additions and 46 deletions
+5 -1
View File
@@ -1,3 +1,5 @@
import { after } from "next/server";
import { sendCommentPush } from "@/lib/comments/push";
import { authorizeComment, commentId, getCommentViewer, listComments, mutateComment, requireCommentViewer } from "@/lib/comments/repository";
import { publishComment } from "@/lib/comments/publish";
import { errorResponse, requireSameOrigin } from "@/lib/security/http";
@@ -18,7 +20,9 @@ export async function PATCH(request: Request, context: Context) {
requireSameOrigin(request);
const viewer = await requireCommentViewer();
await limitRequest("comment-publish", viewer.id, 20);
return Response.json(await publishComment(request, viewer, { id: commentId((await context.params).id) }));
const result = await publishComment(request, viewer, { id: commentId((await context.params).id) });
after(async () => { await sendCommentPush(result.id, result.version).catch(() => console.error("Comment notification failed")); });
return Response.json(result);
} catch (cause) { return errorResponse(cause); }
}
export async function DELETE(request: Request, context: Context) {
+1 -1
View File
@@ -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 sendCommentPush(result.id).catch(() => console.error("Comment notification failed")); });
after(async () => { await sendCommentPush(result.id, result.version).catch(() => console.error("Comment notification failed")); });
return Response.json(result, { status: 201 });
} catch (cause) { return errorResponse(cause); }
}