1
0

Improve pagination (#105)

This commit is contained in:
konrad
2019-10-23 21:11:40 +00:00
parent 89f385a53d
commit 8948a5f219
97 changed files with 2137 additions and 529 deletions

View File

@ -89,7 +89,7 @@ func (vcls *VikunjaCaldavListStorage) GetResources(rpath string, withChildren bo
}
// Otherwise get all lists
thelists, err := vcls.list.ReadAll("", vcls.user, -1)
thelists, _, _, err := vcls.list.ReadAll(vcls.user, "", -1, 50)
if err != nil {
return nil, err
}

View File

@ -16,6 +16,11 @@
// @title Vikunja API
// @description This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> -->
// @description # Pagination
// @description Every endpoint capable of pagination will return two headers:
// @description * `x-pagination-total-pages`: The total number of available pages for this request
// @description * `x-pagination-result-count`: The number of items returned for this request.
// @description # Authorization
// @description **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully.
// @description
@ -110,6 +115,7 @@ func NewEcho() *echo.Echo {
AuthObject: apiv1.GetAuthFromClaims,
})
handler.SetLoggingProvider(log.GetLogger())
handler.SetMaxItemsPerPage(config.ServiceMaxItemsPerPage.GetInt())
return e
}