@@ -193,13 +193,17 @@ 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, unlisted bool, open *bool, limit int) ([]Story, error) {
|
||||
func List(author string, category *string, tags []Tag, earliest, latest time.Time, unlisted bool, open *bool, limit int) ([]Story, error) {
|
||||
query := bson.M{}
|
||||
|
||||
if author != "" {
|
||||
query["author"] = author
|
||||
}
|
||||
|
||||
if category != nil {
|
||||
query["category"] = category
|
||||
}
|
||||
|
||||
if len(tags) > 0 {
|
||||
query["tags"] = bson.M{"$in": tags}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user