mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 16:28:19 +00:00
Review fixes
This commit is contained in:
@@ -112,13 +112,13 @@ export const IDENTITIES = {
|
|||||||
name: "The name of the identity to create.",
|
name: "The name of the identity to create.",
|
||||||
organizationId: "The organization ID to which the identity belongs.",
|
organizationId: "The organization ID to which the identity belongs.",
|
||||||
role: "The role of the identity. Possible values are 'no-access', 'member', and 'admin'.",
|
role: "The role of the identity. Possible values are 'no-access', 'member', and 'admin'.",
|
||||||
hasDeleteProtection: "Whether the identity has delete protection or not."
|
hasDeleteProtection: "Prevents deletion of the identity when enabled."
|
||||||
},
|
},
|
||||||
UPDATE: {
|
UPDATE: {
|
||||||
identityId: "The ID of the identity to update.",
|
identityId: "The ID of the identity to update.",
|
||||||
name: "The new name of the identity.",
|
name: "The new name of the identity.",
|
||||||
role: "The new role of the identity.",
|
role: "The new role of the identity.",
|
||||||
hasDeleteProtection: "Whether the identity now has delete protection or not."
|
hasDeleteProtection: "Prevents deletion of the identity when enabled."
|
||||||
},
|
},
|
||||||
DELETE: {
|
DELETE: {
|
||||||
identityId: "The ID of the identity to delete."
|
identityId: "The ID of the identity to delete."
|
||||||
|
|||||||
@@ -191,9 +191,11 @@ export const identityServiceFactory = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const identity = await identityDAL.transaction(async (tx) => {
|
const identity = await identityDAL.transaction(async (tx) => {
|
||||||
const newIdentity = name
|
const newIdentity =
|
||||||
|
name || hasDeleteProtection
|
||||||
? await identityDAL.updateById(id, { name, hasDeleteProtection }, tx)
|
? await identityDAL.updateById(id, { name, hasDeleteProtection }, tx)
|
||||||
: await identityDAL.findById(id, tx);
|
: await identityDAL.findById(id, tx);
|
||||||
|
|
||||||
if (role) {
|
if (role) {
|
||||||
await identityOrgMembershipDAL.updateById(
|
await identityOrgMembershipDAL.updateById(
|
||||||
identityOrgMembership.id,
|
identityOrgMembership.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user