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

Update custom-entities.md #1490

Merged
merged 2 commits into from
Sep 18, 2019
Merged
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions app/1.2.x/plugin-development/custom-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,10 @@ The returned entity will be the entity after the update takes place, or `nil` +
The following example modifies the `key` field of an existing credential given the credential's id:

``` lua
local entity, err = kong.db.keyauth_credentials:update({
local entity, err = kong.db.keyauth_credentials:update(
{ id = "2b6a2022-770a-49df-874d-11e2bf2634f5" },
{ key = "updated_secret" },
})
{ key = "updated_secret" }
)

if not entity then
kong.log.err("Error when updating keyauth credential: " .. err)
Expand All @@ -575,10 +575,10 @@ local entity, err, err_t = kong.db.<name>:upsert(primary_key, <values>)
Given this code:

``` lua
local entity, err = kong.db.keyauth_credentials:upsert({
local entity, err = kong.db.keyauth_credentials:upsert(
{ id = "2b6a2022-770a-49df-874d-11e2bf2634f5" },
{ consumer = { id = "a96145fb-d71e-4c88-8a5a-2c8b1947534c" } },
})
{ consumer = { id = "a96145fb-d71e-4c88-8a5a-2c8b1947534c" } }
)

if not entity then
kong.log.err("Error when upserting keyauth credential: " .. err)
Expand Down Expand Up @@ -611,9 +611,9 @@ must do it manually, by checking with `select` before invoking `delete`.
Example:

``` lua
local ok, err = kong.db.keyauth_credentials:delete({
local ok, err = kong.db.keyauth_credentials:delete(
{ id = "2b6a2022-770a-49df-874d-11e2bf2634f5" }
})
)

if not ok then
kong.log.err("Error when deleting keyauth credential: " .. err)
Expand Down