mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix(releases): search with postgres (#1181)
* fix(releases): search with postgres * fix: validate release push status from filters * fix: add missing import * fix: validate push status if not empty
This commit is contained in:
parent
faaec5625a
commit
06b864da4d
3 changed files with 29 additions and 1 deletions
|
@ -5,6 +5,7 @@ package http
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
@ -97,6 +98,16 @@ func (h releaseHandler) findReleases(w http.ResponseWriter, r *http.Request) {
|
|||
indexer := vals["indexer"]
|
||||
|
||||
pushStatus := r.URL.Query().Get("push_status")
|
||||
if pushStatus != "" {
|
||||
if !domain.ValidReleasePushStatus(pushStatus) {
|
||||
h.encoder.StatusResponse(w, http.StatusBadRequest, map[string]interface{}{
|
||||
"code": "BAD_REQUEST_PARAMS",
|
||||
"message": fmt.Sprintf("push_status parameter is of invalid type: %v", pushStatus),
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
search := r.URL.Query().Get("q")
|
||||
|
||||
query := domain.ReleaseQueryParams{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue