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:
parent
fad9ad2be4
commit
e878dca3d7
6 changed files with 58 additions and 17 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue