no paging in REST-API by default

This commit is contained in:
Lou Knauer 2022-02-22 14:07:49 +01:00
parent 6ccf354035
commit ef089a7f2b
2 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ type TagJobApiRequest []*struct {
// Return a list of jobs
func (api *RestApi) getJobs(rw http.ResponseWriter, r *http.Request) {
filter := &model.JobFilter{}
page := &model.PageRequest{ItemsPerPage: 50, Page: 1}
page := &model.PageRequest{ItemsPerPage: -1, Page: 1}
order := &model.OrderByInput{Field: "startTime", Order: model.SortDirectionEnumDesc}
for key, vals := range r.URL.Query() {
switch key {

View File

@ -35,7 +35,7 @@ func (r *JobRepository) QueryJobs(
}
}
if page != nil {
if page != nil && page.ItemsPerPage != -1 {
limit := uint64(page.ItemsPerPage)
query = query.Offset((uint64(page.Page) - 1) * limit).Limit(limit)
}