fix: slide 3 noire, watermark PPTX, quota génération slides
Some checks failed
CI / Lint, Unit Tests & Build (push) Successful in 5m44s
CI / Deploy production (on server) (push) Failing after 17s

- canvas-board.tsx: préfère data.html (iframe) sur data.spec (ancien renderer)
  → corrige slide 3 noire en mode HTML viewer
- pptx/route.ts: ajoute watermark 'memento-note.com' sur chaque slide
  via buildPptx (PPTX téléchargé depuis le canvas)
- run-for-note/route.ts: checkEntitlementOrThrow avant création agent
- slides.tool.ts: incrementUsageAsync après canvas créé avec succès

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Antigravity
2026-05-29 11:58:31 +00:00
parent 45fd501953
commit 9e23c078e9
4 changed files with 28 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
import { NextRequest, NextResponse } from 'next/server'
import { auth } from '@/auth'
import { prisma } from '@/lib/prisma'
import { checkEntitlementOrThrow, QuotaExceededError, incrementUsageAsync } from '@/lib/entitlements'
type GenerateType = 'slide-generator' | 'excalidraw-generator'
@@ -43,6 +44,16 @@ export async function POST(req: NextRequest) {
return NextResponse.json({ error: 'Paramètres invalides' }, { status: 400 })
}
// Quota check — slides/excalidraw generation counts as 'reformulate' credit
try {
await checkEntitlementOrThrow(userId, 'reformulate')
} catch (e) {
if (e instanceof QuotaExceededError) {
return NextResponse.json({ error: e.message }, { status: 402 })
}
throw e
}
const note = await prisma.note.findFirst({
where: { id: noteId, userId },
select: { id: true, title: true, notebookId: true },