fix: increase markdown transform word limit to 2000 + i18n errors
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 43s

Same fix as reformulate — raise limit from 500 to 2000 and use i18n
error keys instead of hardcoded English messages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-30 21:29:17 +02:00
parent 907dcf33d6
commit 7053e242d2

View File

@@ -22,14 +22,14 @@ export async function POST(request: NextRequest) {
const wordCount = text.split(/\s+/).length
if (wordCount < 10) {
return NextResponse.json(
{ error: 'Text must have at least 10 words to transform' },
{ errorKey: 'ai.wordCountMin', params: { min: 10, current: wordCount } },
{ status: 400 }
)
}
if (wordCount > 500) {
if (wordCount > 2000) {
return NextResponse.json(
{ error: 'Text must have maximum 500 words to transform' },
{ errorKey: 'ai.wordCountMax', params: { max: 2000, current: wordCount } },
{ status: 400 }
)
}