Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(get): propagate next page size param #9029 #9503

Merged
merged 22 commits into from
Nov 1, 2022
Merged
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
503eb49
fix(get): propagate next page size param #9029
jacksjm Oct 7, 2022
4f4faf8
fix: change to use args.size only if is a number
jacksjm Oct 10, 2022
ddce936
fix(style): remove (...) on if
jacksjm Oct 11, 2022
3a5a988
Merge branch 'master' into fix/propagate-next
jacksjm Oct 17, 2022
9434302
Merge branch 'master' into fix/propagate-next
jacksjm Oct 20, 2022
bae6da6
Merge branch 'master' into fix/propagate-next
jacksjm Oct 21, 2022
e7e636f
Merge branch 'master' into fix/propagate-next
jacksjm Oct 26, 2022
d5b93e1
fix: includes %s on a fmt string
jacksjm Oct 26, 2022
30cea7c
Merge branch 'fix/propagate-next' of github.com:jacksjm/kong into fix…
jacksjm Oct 26, 2022
ff06fbf
chore: create unit test
jacksjm Oct 28, 2022
e22eba8
Merge branch 'master' into fix/propagate-next
jacksjm Oct 28, 2022
57e3fc0
fix: change to only valid nil value
jacksjm Oct 29, 2022
4750789
fix(get): propagate next page size param #9029
jacksjm Oct 7, 2022
fa355bb
fix: change to use args.size only if is a number
jacksjm Oct 10, 2022
7dce8df
fix(style): remove (...) on if
jacksjm Oct 11, 2022
862a2df
fix: includes %s on a fmt string
jacksjm Oct 26, 2022
5bc1959
chore: create unit test
jacksjm Oct 28, 2022
313c389
fix: change to only valid nil value
jacksjm Oct 29, 2022
66e96a5
Merge branch 'master' into fix/propagate-next
jacksjm Oct 31, 2022
ed435cb
fix: change test style
jacksjm Oct 31, 2022
6eb8099
Merge branch 'fix/propagate-next' of github.com:jacksjm/kong into fix…
jacksjm Oct 31, 2022
d0caef9
Merge branch 'master' into fix/propagate-next
fffonion Nov 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion kong/api/endpoints.lua
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,17 @@ end
local function get_collection_endpoint(schema, foreign_schema, foreign_field_name, method)
return not foreign_schema and function(self, db, helpers)
local next_page_tags = ""
local next_page_size = ""

local args = self.args.uri
if args.tags then
next_page_tags = "&tags=" .. escape_uri(type(args.tags) == "table" and args.tags[1] or args.tags)
end

if (type(args.size) == "number") then
chronolaw marked this conversation as resolved.
Show resolved Hide resolved
next_page_size = "&size=" .. args.size
end

local data, _, err_t, offset = page_collection(self, db, schema, method)
if err_t then
return handle_error(err_t)
Expand All @@ -318,7 +323,8 @@ local function get_collection_endpoint(schema, foreign_schema, foreign_field_nam
schema.admin_api_name or
schema.name,
escape_uri(offset),
next_page_tags) or null
next_page_tags,
next_page_size) or null
jacksjm marked this conversation as resolved.
Show resolved Hide resolved

return ok {
data = data,
Expand Down