fix ExistRecommend

This commit is contained in:
aichy126 2022-11-16 15:35:43 +08:00
parent 952757e2da
commit 19075b869e
1 changed files with 7 additions and 0 deletions

View File

@ -143,6 +143,13 @@ func (ts *TagCommonService) GetTagListByNames(ctx context.Context, tagNames []st
}
func (ts *TagCommonService) ExistRecommend(ctx context.Context, tags []*schema.TagItem) (bool, error) {
taginfo, err := ts.siteInfoService.GetSiteWrite(ctx)
if err != nil {
return false, err
}
if !taginfo.RequiredTag {
return true, nil
}
tagNames := make([]string, 0)
for _, item := range tags {
tagNames = append(tagNames, item.SlugName)