fix: quota slide_generate pour tier BASIC
- Ajoute slide_generate et excalidraw_generate dans TIER_LIMITS (BASIC: 3, PRO: 20, BUSINESS: 100, ENTERPRISE: unlimited) - run-for-note: utilise le bon feature key selon le type d'agent - slides.tool: incrémente slide_generate (pas reformulate) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -44,9 +44,10 @@ export async function POST(req: NextRequest) {
|
||||
return NextResponse.json({ error: 'Paramètres invalides' }, { status: 400 })
|
||||
}
|
||||
|
||||
// Quota check — slides/excalidraw generation counts as 'reformulate' credit
|
||||
// Quota check — feature key depends on generation type
|
||||
const featureKey = type === 'slide-generator' ? 'slide_generate' : 'excalidraw_generate'
|
||||
try {
|
||||
await checkEntitlementOrThrow(userId, 'reformulate')
|
||||
await checkEntitlementOrThrow(userId, featureKey)
|
||||
} catch (e) {
|
||||
if (e instanceof QuotaExceededError) {
|
||||
return NextResponse.json({ error: e.message }, { status: 402 })
|
||||
|
||||
Reference in New Issue
Block a user