Skip to content

Commit

Permalink
refactor(v1_keys_createKey.ts): improve code formatting for inserting…
Browse files Browse the repository at this point in the history
… role and permission mappings into the database
  • Loading branch information
chronark committed Sep 4, 2024
1 parent f847d33 commit 6e2e75e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions apps/api/src/routes/v1_keys_createKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,21 +413,21 @@ export const registerV1KeysCreateKey = (app: App) =>
await Promise.all([
roleIds.length > 0
? db.primary.insert(schema.keysRoles).values(
roleIds.map((roleId) => ({
keyId: newKey.id,
roleId,
workspaceId: authorizedWorkspaceId,
})),
)
roleIds.map((roleId) => ({
keyId: newKey.id,
roleId,
workspaceId: authorizedWorkspaceId,
})),
)
: Promise.resolve(),
permissionIds.length > 0
? db.primary.insert(schema.keysPermissions).values(
permissionIds.map((permissionId) => ({
keyId: newKey.id,
permissionId,
workspaceId: authorizedWorkspaceId,
})),
)
permissionIds.map((permissionId) => ({
keyId: newKey.id,
permissionId,
workspaceId: authorizedWorkspaceId,
})),
)
: Promise.resolve(),
]);

Expand Down

0 comments on commit 6e2e75e

Please sign in to comment.