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.

fix: tag not exist error

LinkinStar72866de5c1d1
diff --git a/internal/service/tag_common/tag_common.go b/internal/service/tag_common/tag_common.go
index 4d119c1f..bb65c5c1 100644
--- a/internal/service/tag_common/tag_common.go
+++ b/internal/service/tag_common/tag_common.go
@@ -263,9 +263,8 @@ func (ts *TagCommonService) UpdateTag(ctx context.Context, tags []string, userID
}
if len(addTagList) > 0 {
- err = fmt.Errorf("add a tag does not exist")
- TagMsgList := strings.Replace(strings.Trim(fmt.Sprint(addTagMsgList), "[]"), " ", ",", -1)
- errors.BadRequest(reason.TagNotFound).WithMsg(TagMsgList)
+ err = errors.BadRequest(reason.TagNotFound).WithMsg(fmt.Sprintf("tag [%s] does not exist",
+ strings.Join(addTagMsgList, ",")))
return err
// todo if need add
// err = ts.tagRepo.AddTagList(ctx, addTagList)