Skip to content

Commit

Permalink
fix tags
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed Dec 17, 2024
1 parent 372553f commit 7785eec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions kong/db/strategies/off/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ end
-- ws_id here.
local function page_for_tags(self, size, offset, options)
-- /:entitiy?tags=:tags
-- search all key-values: <entity_name>|*|*|<pk_string> => actual item key
-- search all key-values: I|<entity_name>|*|<pk_string> => actual item key
if self.schema.name ~= "tags" then
local prefix = item_key_prefix(self.schema.name, "*") -- "<entity_name>|*|*|"
local prefix = item_key_prefix(self.schema.name, "*") -- "I|<entity_name>|"
local items, err, offset = page_for_prefix(self, prefix, size, offset,
options, true)
options)
if not items then
return nil, err
end
Expand Down Expand Up @@ -273,7 +273,7 @@ local function page_for_tags(self, size, offset, options)
local rows, err

rows, err, offset_token = page_for_prefix(self, prefix, size, offset_token,
options, true, dao.schema)
options, false, dao.schema)
if not rows then
return nil, err
end
Expand Down
5 changes: 3 additions & 2 deletions spec/02-integration/04-admin_api/14-tags_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ local cjson = require "cjson"
-- This test we test on the correctness of the admin API response so that
-- we can ensure the right function (page()) is executed.
describe("Admin API - tags", function()
for _, strategy in helpers.all_strategies() do
-- for _, strategy in helpers.all_strategies() do
for _, strategy in ipairs({"off"}) do
describe("/entities?tags= with DB: #" .. strategy, function()
local client, bp

Expand Down Expand Up @@ -156,7 +157,7 @@ describe("Admin API - tags", function()
assert.equals("invalid option (tags: invalid filter syntax)", json.message)
end)

it("returns the correct 'next' arg", function()
it("returns the correct 'next' arg #ttt", function()
local tags_arg = 'tags=corp_%20a'
local res = assert(client:send {
method = "GET",
Expand Down

0 comments on commit 7785eec

Please sign in to comment.