mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(core): simplify increasePasscodeTryCount and consumePasscode (#1513)
This commit is contained in:
parent
f479a1566f
commit
94a67bfb42
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ export const consumePasscode = async (id: string) =>
|
|||
envSet.pool.query<Passcode>(sql`
|
||||
update ${table}
|
||||
set ${fields.consumed}=true
|
||||
where ${fields.id}=${sql`${id}`}
|
||||
where ${fields.id}=${id}
|
||||
returning ${sql.join(Object.values(fields), sql`, `)}
|
||||
`);
|
||||
|
||||
|
@ -38,7 +38,7 @@ export const increasePasscodeTryCount = async (id: string) =>
|
|||
envSet.pool.query<Passcode>(sql`
|
||||
update ${table}
|
||||
set ${fields.tryCount}=${fields.tryCount}+1
|
||||
where ${fields.id}=${sql`${id}`}
|
||||
where ${fields.id}=${id}
|
||||
returning ${sql.join(Object.values(fields), sql`, `)}
|
||||
`);
|
||||
|
||||
|
|
Loading…
Reference in a new issue