feat: implement admin video upload system with platform integration for YouTube and TikTok

This commit is contained in:
2026-08-02 02:07:35 +07:00 Unverified
parent 7cec08fb77
commit 698b12039a
22 changed files with 1727 additions and 14 deletions
+18
View File
@@ -0,0 +1,18 @@
import { NextResponse } from "next/server";
import { requireAdmin } from "@/lib/auth";
import { saveVideoUpload } from "@/lib/video-upload-storage";
export const dynamic = "force-dynamic";
export async function POST(request: Request) {
try {
const discordId = await requireAdmin();
const id = await saveVideoUpload(await request.formData(), discordId);
return NextResponse.json({ id });
} catch (error) {
const message = error instanceof Error ? error.message : "Upload failed.";
const status =
message === "Unauthorized" || message === "Not authenticated" ? 401 : 400;
return NextResponse.json({ error: message }, { status });
}
}