0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(core): refine query

This commit is contained in:
Gao Sun 2023-06-05 12:51:35 +08:00
parent 08c5771a85
commit 17d72c8564
No known key found for this signature in database
GPG key ID: 13EBE123E4773688

View file

@ -38,7 +38,7 @@ export const createResourceQueries = (pool: CommonQueryMethods) => {
await connection.query(sql` await connection.query(sql`
update ${table} update ${table}
set ${fields.isDefault}=false set ${fields.isDefault}=false
where ${fields.id}!=${id}; where ${fields.isDefault}=true;
`); `);
const returning = await connection.maybeOne<Resource>(sql` const returning = await connection.maybeOne<Resource>(sql`
update ${table} update ${table}