ab4e340db9
/onboarding: 3-шаговый вайзард (платформа → название/ниша → готово)
login/page.js: новый пользователь → /onboarding, существующий → /
TopicBank.js: просмотр/пополнение/добавление/удаление тем
ChannelEdit AI-стиль: TopicBank компонент внизу вкладки
channels/new: при 402 CHANNEL_LIMIT_REACHED → ошибка + redirect /plans
lib/engine.js: ENGINE_URL дефолт 3040 → 3030
API routes: /api/topics-bank/[channelId]/{refill,add}, /item/[id]
15 lines
602 B
JavaScript
15 lines
602 B
JavaScript
import { NextResponse } from 'next/server';
|
|
import { requireUser } from '@/lib/session';
|
|
|
|
const ENGINE_URL = process.env.ENGINE_URL || 'http://localhost:3030';
|
|
const ENGINE_SECRET = process.env.ENGINE_SECRET || '';
|
|
|
|
export async function DELETE(req, { params }) {
|
|
const user = await requireUser();
|
|
if (!user) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
|
|
const res = await fetch(`${ENGINE_URL}/api/generate/topics-bank/item/${params.id}`, {
|
|
method: 'DELETE', headers: { 'x-internal-secret': ENGINE_SECRET },
|
|
});
|
|
return NextResponse.json(await res.json());
|
|
}
|