Added open and unlsited to StoriesFilter
the build was successful

This commit is contained in:
2018-08-01 14:27:28 +02:00
parent ca98648274
commit d5df624188
5 changed files with 40 additions and 2 deletions
+7 -1
View File
@@ -193,7 +193,7 @@ func FindID(id string) (Story, error) {
}
// List lists stories by any non-zero criteria passed with it.
func List(author string, tags []Tag, earliest, latest time.Time, limit int) ([]Story, error) {
func List(author string, tags []Tag, earliest, latest time.Time, unlisted bool, open *bool, limit int) ([]Story, error) {
query := bson.M{}
if author != "" {
@@ -219,6 +219,12 @@ func List(author string, tags []Tag, earliest, latest time.Time, limit int) ([]S
}
}
query["unlisted"] = unlisted
if open != nil {
query["open"] = *open
}
stories := make([]Story, 0, 128)
err := storyCollection.Find(query).Limit(limit).All(&stories)