make API pagination optional
This commit is contained in:
parent
e03d627769
commit
05bb9d06da
@ -41,8 +41,12 @@ func GetQueryBeforeSince(ctx *context.APIContext) (before, since int64, err erro
|
||||
|
||||
// GetListOptions returns list options using the page and limit parameters
|
||||
func GetListOptions(ctx *context.APIContext) models.ListOptions {
|
||||
page := ctx.QueryInt("page")
|
||||
if page == 0 {
|
||||
return models.ListOptions{}
|
||||
}
|
||||
return models.ListOptions{
|
||||
Page: ctx.QueryInt("page"),
|
||||
Page: page,
|
||||
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user