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 }, ); }