1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

Add API parameter to filter entries by category

This commit is contained in:
Frédéric Guillot 2019-11-17 22:53:11 -08:00
parent fad9ad2be4
commit e878dca3d7
6 changed files with 58 additions and 17 deletions

View file

@ -103,7 +103,7 @@ func (e *EntryQueryBuilder) WithFeedID(feedID int64) *EntryQueryBuilder {
// WithCategoryID set the categoryID.
func (e *EntryQueryBuilder) WithCategoryID(categoryID int64) *EntryQueryBuilder {
if categoryID != 0 {
if categoryID > 0 {
e.conditions = append(e.conditions, fmt.Sprintf("f.category_id = $%d", len(e.args)+1))
e.args = append(e.args, categoryID)
}