fix: tag not exist error

This commit is contained in:
LinkinStar 2022-11-15 14:14:20 +08:00
parent a66cf236ef
commit 72866de5c1
1 changed files with 2 additions and 3 deletions

View File

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