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.
fix question tags update error
aichy1260df1ab82facd
diff --git a/internal/service/question_service.go b/internal/service/question_service.goindex 3811c8ae..d3726eba 100644--- a/internal/service/question_service.go+++ b/internal/service/question_service.go@@ -9,6 +9,7 @@ import ("github.com/answerdev/answer/internal/base/constant""github.com/answerdev/answer/internal/base/reason""github.com/answerdev/answer/internal/base/translator"+ "github.com/answerdev/answer/internal/base/validator""github.com/answerdev/answer/internal/entity""github.com/answerdev/answer/internal/schema""github.com/answerdev/answer/internal/service/activity"@@ -206,7 +207,7 @@ func (qs *QuestionService) RemoveQuestion(ctx context.Context, req *schema.Remov}// UpdateQuestion update question-func (qs *QuestionService) UpdateQuestion(ctx context.Context, req *schema.QuestionUpdate) (questionInfo *schema.QuestionInfo, err error) {+func (qs *QuestionService) UpdateQuestion(ctx context.Context, req *schema.QuestionUpdate) (questionInfo any, err error) {questionInfo = &schema.QuestionInfo{}now := time.Now()question := &entity.Question{}@@ -252,9 +253,15 @@ func (qs *QuestionService) UpdateQuestion(ctx context.Context, req *schema.QuestCheckTag, CheckTaglist := qs.CheckChangeReservedTag(ctx, oldTags, Tags)if !CheckTag {- err = errors.BadRequest(reason.RequestFormatError).WithMsg(fmt.Sprintf("The reserved tag \"%s\" must be present.",- strings.Join(CheckTaglist, ",")))- return+ errMsg := fmt.Sprintf(`The reserved tag %s must be present.`,+ strings.Join(CheckTaglist, ","))+ errorlist := make([]*validator.FormErrorField, 0)+ errorlist = append(errorlist, &validator.FormErrorField{+ ErrorField: "tags",+ ErrorMsg: errMsg,+ })+ err = errors.BadRequest(reason.RequestFormatError).WithMsg(errMsg)+ return errorlist, err}//update question to db