feat: P4 ChannelAnalytics tab; P5 FromUrlModal + URL→draft in ChannelView

This commit is contained in:
Nik (Claude)
2026-06-08 11:09:03 +03:00
parent b8a570f04a
commit eac6e2ed13
7 changed files with 555 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { NextResponse } from 'next/server';
import { requireUser } from '@/lib/session';
import { engine } from '@/lib/engine';
export async function POST(request) {
const user = await requireUser();
if (!user) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
const body = await request.json();
if (!body.channelId || !body.url) {
return NextResponse.json({ error: 'channelId and url required' }, { status: 400 });
}
try {
const data = await engine.generateFromUrl(user.id, body);
return NextResponse.json(data);
} catch (err) {
return NextResponse.json({ error: err.message }, { status: err.status || 500 });
}
}