mirror of
https://github.com/r3-team/r3.git
synced 2026-04-30 13:30:35 -05:00
Fix: API not applying query fixed result limit
This commit is contained in:
+4
-1
@@ -320,6 +320,10 @@ func Handler(w http.ResponseWriter, r *http.Request) {
|
||||
Offset: getters.offset,
|
||||
}
|
||||
|
||||
if api.Query.FixedLimit != 0 && api.Query.FixedLimit < dataGet.Limit {
|
||||
dataGet.Limit = api.Query.FixedLimit
|
||||
}
|
||||
|
||||
// abort if requested limit exceeds max limit
|
||||
// better to abort as smaller than requested result count might suggest the absence of more data
|
||||
if api.LimitMax < dataGet.Limit {
|
||||
@@ -380,7 +384,6 @@ func Handler(w http.ResponseWriter, r *http.Request) {
|
||||
abort(http.StatusServiceUnavailable, nil, err.Error())
|
||||
return
|
||||
}
|
||||
fmt.Println(query)
|
||||
|
||||
// parse output
|
||||
rows := make([]interface{}, 0)
|
||||
|
||||
Reference in New Issue
Block a user