Changed story.ListTags to ignore tags for unlisted stories
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ func (tag *Tag) Equal(other Tag) bool {
|
|||||||
// ListTags lists all tags
|
// ListTags lists all tags
|
||||||
func ListTags() ([]Tag, error) {
|
func ListTags() ([]Tag, error) {
|
||||||
tags := make([]Tag, 0, 64)
|
tags := make([]Tag, 0, 64)
|
||||||
err := storyCollection.Find(bson.M{"tags": bson.M{"$ne": nil}}).Distinct("tags", &tags)
|
err := storyCollection.Find(bson.M{"listed": true, "tags": bson.M{"$ne": nil}}).Distinct("tags", &tags)
|
||||||
|
|
||||||
sort.Slice(tags, func(i, j int) bool {
|
sort.Slice(tags, func(i, j int) bool {
|
||||||
kindCmp := strings.Compare(tags[i].Kind, tags[j].Kind)
|
kindCmp := strings.Compare(tags[i].Kind, tags[j].Kind)
|
||||||
|
|||||||
Reference in New Issue
Block a user