From a6feac023c5602b94a1166daf026f6be2bcf284e Mon Sep 17 00:00:00 2001
From: Denis Bykhov <bykhov.denis@gmail.com>
Date: Wed, 28 Aug 2024 14:03:27 +0500
Subject: [PATCH] Remove apply for create workspace (#6416)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
---
 server/account/src/operations.ts | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/server/account/src/operations.ts b/server/account/src/operations.ts
index ee7a5451f9..4baffeecb0 100644
--- a/server/account/src/operations.ts
+++ b/server/account/src/operations.ts
@@ -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()