0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

fix(core): insert id when patch application (#3052)

This commit is contained in:
Gao Sun 2023-02-03 17:23:39 +08:00 committed by GitHub
parent 8f61cf7161
commit f298e1c296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,9 +18,11 @@ export const createApplicationsRolesQueries = (pool: CommonQueryMethods) => {
const insertApplicationsRoles = async (applicationsRoles: CreateApplicationsRole[]) =>
pool.query(sql`
insert into ${table} (${fields.applicationId}, ${fields.roleId}) values
insert into ${table} (${fields.id}, ${fields.applicationId}, ${fields.roleId}) values
${sql.join(
applicationsRoles.map(({ applicationId, roleId }) => sql`(${applicationId}, ${roleId})`),
applicationsRoles.map(
({ id, applicationId, roleId }) => sql`(${id}, ${applicationId}, ${roleId})`
),
sql`, `
)}
`);