0
Fork 0
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:
IceHe.xyz 2022-07-11 22:56:12 +08:00 committed by GitHub
parent f479a1566f
commit 94a67bfb42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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`, `)}
`);