1
0
Fork 0
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:
Frank Jogeleit 2022-06-04 10:18:02 +02:00
parent f00e45b540
commit 6040b8e087
3 changed files with 2 additions and 4 deletions

View file

@ -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

View file

@ -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" {

View file

@ -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, ","),