@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user