mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-05 15:24:22 +00: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.class.Channel,
|
||||||
contact.space.Contacts,
|
contact.space.Contacts,
|
||||||
employee._id,
|
employee._id,
|
||||||
contact.mixin.Employee,
|
contact.class.Person,
|
||||||
'channels',
|
'channels',
|
||||||
{
|
{
|
||||||
provider: contact.channelProvider.Email,
|
provider: contact.channelProvider.Email,
|
||||||
@ -1926,10 +1926,11 @@ async function createPersonAccount (
|
|||||||
const currentAccount = await ops.findOne(contact.class.PersonAccount, {})
|
const currentAccount = await ops.findOne(contact.class.PersonAccount, {})
|
||||||
if (currentAccount !== undefined) {
|
if (currentAccount !== undefined) {
|
||||||
await replaceCurrentAccount(ops, account, currentAccount, name)
|
await replaceCurrentAccount(ops, account, currentAccount, name)
|
||||||
|
await ops.commit()
|
||||||
return
|
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 })
|
const existingAccount = await ops.findOne(contact.class.PersonAccount, { email: account.email })
|
||||||
if (existingAccount === undefined) {
|
if (existingAccount === undefined) {
|
||||||
let person: Ref<Person> | undefined
|
let person: Ref<Person> | undefined
|
||||||
|
Loading…
Reference in New Issue
Block a user