Skip to content

Commit

Permalink
Update custom-entities.md (#1490)
Browse files Browse the repository at this point in the history
* Update custom-entities.md

Remove extra brackets and commas

* Update custom-entities.md
  • Loading branch information
levfishbluefish authored Sep 18, 2019
1 parent 08f0f98 commit 2f59b29
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit 2f59b29

Please sign in to comment.