mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
Fix workspace create (#6413)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
4cce003364
commit
86c69b4149
@ -1887,7 +1887,7 @@ async function replaceCurrentAccount (
|
||||
contact.class.Channel,
|
||||
contact.space.Contacts,
|
||||
employee._id,
|
||||
contact.mixin.Employee,
|
||||
contact.class.Person,
|
||||
'channels',
|
||||
{
|
||||
provider: contact.channelProvider.Email,
|
||||
@ -1926,10 +1926,11 @@ async function createPersonAccount (
|
||||
const currentAccount = await ops.findOne(contact.class.PersonAccount, {})
|
||||
if (currentAccount !== undefined) {
|
||||
await replaceCurrentAccount(ops, account, currentAccount, name)
|
||||
await ops.commit()
|
||||
return
|
||||
}
|
||||
}
|
||||
const shouldCreateEmployee = roleOrder[role] >= roleOrder[AccountRole.User]
|
||||
const shouldCreateEmployee = roleOrder[role] >= roleOrder[AccountRole.Guest]
|
||||
const existingAccount = await ops.findOne(contact.class.PersonAccount, { email: account.email })
|
||||
if (existingAccount === undefined) {
|
||||
let person: Ref<Person> | undefined
|
||||
|
Loading…
Reference in New Issue
Block a user