Files
worst_web/src/app/api/posts/[id]/publish/route.ts
T
renato97 25449aa5df feat: worst-scan fansub web — initial release
Posts engine (SQLite + auto-publisher via poller), public feed with
clickable tags, reader, admin panel, submit/search/queue tools.
BFF proxy to pipeline API. Clean dark design. Docker-ready.
2026-07-23 15:58:28 -03:00

15 lines
475 B
TypeScript

import { NextRequest } from "next/server"
import { publishPost } from "@/lib/db"
export async function POST(
req: NextRequest,
{ params }: { params: Promise<{ id: string }> },
) {
const { id } = await params
const body = await req.json().catch(() => ({}))
const publish = body.publish !== false
const post = publishPost(Number(id), publish)
if (!post) return Response.json({ error: "Post not found" }, { status: 404 })
return Response.json({ data: post })
}