diff options
Diffstat (limited to 'api4/params.go')
-rw-r--r-- | api4/params.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api4/params.go b/api4/params.go index aa865fd2a..d952eb65a 100644 --- a/api4/params.go +++ b/api4/params.go @@ -39,6 +39,7 @@ type ApiParams struct { JobType string Page int PerPage int + Permanent bool } func ApiParamsFromRequest(r *http.Request) *ApiParams { @@ -132,6 +133,10 @@ func ApiParamsFromRequest(r *http.Request) *ApiParams { params.Page = val } + if val, err := strconv.ParseBool(r.URL.Query().Get("permanent")); err != nil { + params.Permanent = val + } + if val, err := strconv.Atoi(r.URL.Query().Get("per_page")); err != nil || val < 0 { params.PerPage = PER_PAGE_DEFAULT } else if val > PER_PAGE_MAXIMUM { |