fix(brand-questions): surface seed topic min length as actionable error
Reject AI seed topics shorter than 2 characters on both client and server with a dedicated invalid_seed_topic error code, and render an inline hint listing the offending terms so users know exactly what to fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -218,7 +218,7 @@ func (s *QuestionExpansionService) GenerateByAIDistill(ctx context.Context, bran
|
||||
actor := auth.MustActor(ctx)
|
||||
seedTopic := normalizeQuestionText(req.SeedTopic)
|
||||
if utf8.RuneCountInString(seedTopic) < 2 {
|
||||
return nil, response.ErrBadRequest(40091, "invalid_params", "seed_topic is required")
|
||||
return nil, response.ErrBadRequest(40091, "invalid_seed_topic", "seed_topic must contain at least 2 characters")
|
||||
}
|
||||
|
||||
brandCtx, err := s.loadQuestionBrandContext(ctx, actor.TenantID, brandID)
|
||||
|
||||
Reference in New Issue
Block a user