mirror of
https://github.com/kyverno/policy-reporter.git
synced 2024-12-14 11:57:32 +00:00
Optional Offsetn
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
This commit is contained in:
parent
f00e45b540
commit
6040b8e087
3 changed files with 2 additions and 4 deletions
2
.github/workflows/cr.yaml
vendored
2
.github/workflows/cr.yaml
vendored
|
@ -21,8 +21,6 @@ jobs:
|
|||
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@v1
|
||||
with:
|
||||
version: v3.4.0
|
||||
|
||||
- name: Run chart-releaser
|
||||
uses: helm/chart-releaser-action@v1.2.1
|
||||
|
|
|
@ -256,7 +256,7 @@ func buildPaginatiomn(req *http.Request) Pagination {
|
|||
}
|
||||
offset, err := strconv.Atoi(req.URL.Query().Get("offset"))
|
||||
if err != nil || offset < 1 {
|
||||
offset = 20
|
||||
offset = 0
|
||||
}
|
||||
direction := "ASC"
|
||||
if strings.ToLower(req.URL.Query().Get("direction")) == "desc" {
|
||||
|
|
|
@ -969,7 +969,7 @@ func generateFilterWhere(filter api.Filter, active []string) (string, []interfac
|
|||
}
|
||||
|
||||
func generatePagination(pagination api.Pagination) string {
|
||||
if pagination.Page == 0 {
|
||||
if pagination.Page == 0 || pagination.Offset == 0 {
|
||||
return fmt.Sprintf(
|
||||
"ORDER BY %s %s",
|
||||
strings.Join(pagination.SortBy, ","),
|
||||
|
|
Loading…
Reference in a new issue