mirror of
https://github.com/miniflux/v2.git
synced 2025-08-06 17:41:00 +00:00
API: Add the possibility to filter entries by a list of statuses
This commit is contained in:
parent
1c103337fe
commit
04c4890124
3 changed files with 36 additions and 9 deletions
|
@ -111,8 +111,8 @@ func (h *handler) getFeedEntries(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func (h *handler) getEntries(w http.ResponseWriter, r *http.Request) {
|
||||
status := request.QueryStringParam(r, "status", "")
|
||||
if status != "" {
|
||||
statuses := request.QueryStringParamList(r, "status")
|
||||
for _, status := range statuses {
|
||||
if err := model.ValidateEntryStatus(status); err != nil {
|
||||
json.BadRequest(w, r, err)
|
||||
return
|
||||
|
@ -139,7 +139,7 @@ func (h *handler) getEntries(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
builder := h.store.NewEntryQueryBuilder(request.UserID(r))
|
||||
builder.WithStatus(status)
|
||||
builder.WithStatuses(statuses)
|
||||
builder.WithOrder(order)
|
||||
builder.WithDirection(direction)
|
||||
builder.WithOffset(offset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue