From e163746d87fe135cffbb4e6be9d15ae0e5c323f5 Mon Sep 17 00:00:00 2001 From: Ryan Salazar Date: Thu, 28 May 2026 14:39:37 +0000 Subject: [PATCH] submission-receive: name the disallowed phrase in error + support link 422 response now reads "Your submission contains disallowed phrase X. Please remove it and try again. Questions? Email support@relevantmediaproperties.com." so PR firms know exactly what tripped the filter without having to ask. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/api/submission-receive/route.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/api/submission-receive/route.ts b/src/app/api/submission-receive/route.ts index b7c1141..0b967da 100644 --- a/src/app/api/submission-receive/route.ts +++ b/src/app/api/submission-receive/route.ts @@ -39,11 +39,17 @@ export async function POST(request: NextRequest) { // Editorial guardrail: reject anything mentioning a disallowed phrase // (competitor publications, banned exhibitors, etc.) before it ever lands - // in bb.native_articles. + // in bb.native_articles. The error names the specific phrase(s) so the + // submitter knows what to edit, and points them at support for context. const violations = await findViolations(`${title}\n${content}`); if (violations.length > 0) { + const phraseList = violations.map((v) => `"${v.phrase}"`).join(', '); return NextResponse.json( - { error: 'Submission rejected: contains disallowed phrases', violations }, + { + error: `Your submission contains disallowed phrase${violations.length > 1 ? 's' : ''}: ${phraseList}. Please remove ${violations.length > 1 ? 'them' : 'it'} and try again. Questions? Email support@relevantmediaproperties.com.`, + violations, + support_email: 'support@relevantmediaproperties.com', + }, { status: 422 }, ); }