Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

update question validate

aichy126e3557b9c98fc
diff --git a/internal/schema/question_schema.go b/internal/schema/question_schema.go
index f8f4bd87..b656b834 100644
--- a/internal/schema/question_schema.go
+++ b/internal/schema/question_schema.go
@@ -41,7 +41,7 @@ type ReopenQuestionReq struct {
type QuestionAdd struct {
// question title
- Title string `validate:"required,gte=6,lte=150" json:"title"`
+ Title string `validate:"required,notblank,gte=6,lte=150" json:"title"`
// content
Content string `validate:"required,notblank,gte=6,lte=65535" json:"content"`
// html
@@ -90,7 +90,7 @@ type QuestionUpdate struct {
// question id
ID string `validate:"required" json:"id"`
// question title
- Title string `validate:"required,gte=6,lte=150" json:"title"`
+ Title string `validate:"required,notblank,gte=6,lte=150" json:"title"`
// content
Content string `validate:"required,notblank,gte=6,lte=65535" json:"content"`
// html