Remove apply for create workspace (#6416)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-08-28 14:03:27 +05:00 committed by GitHub
parent 86c69b4149
commit a6feac023c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1918,7 +1918,7 @@ async function createPersonAccount (
const connection =
client ?? (await connect(getEndpoint(ctx, workspaceInfo, EndpointKind.Internal), getWorkspaceId(workspace)))
try {
const ops = new TxOperations(connection, core.account.System).apply('create-person' + generateId())
const ops = new TxOperations(connection, core.account.System)
const name = combineName(account.first, account.last)
// Check if PersonAccount is not exists
@ -1926,7 +1926,6 @@ async function createPersonAccount (
const currentAccount = await ops.findOne(contact.class.PersonAccount, {})
if (currentAccount !== undefined) {
await replaceCurrentAccount(ops, account, currentAccount, name)
await ops.commit()
return
}
}
@ -1969,7 +1968,6 @@ async function createPersonAccount (
}
}
}
await ops.commit()
} finally {
if (client === undefined) {
await connection.close()