mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
Change name in profile fix (#2534)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
a5e512cea2
commit
b5ca5e438b
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright © 2022 Hardcore Engineering Inc.
|
||||
// Copyright © 2022-2023 Hardcore Engineering Inc.
|
||||
//
|
||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License. You may
|
||||
@ -660,15 +660,13 @@ export async function changeName (db: Db, productId: string, token: string, firs
|
||||
|
||||
const workspaces = await db
|
||||
.collection<Workspace>(WORKSPACE_COLLECTION)
|
||||
.find({ _id: { $in: account.workspaces } })
|
||||
.find(withProductId(productId, { _id: { $in: account.workspaces } }))
|
||||
.toArray()
|
||||
|
||||
const promises: Promise<void>[] = []
|
||||
for (const ws of workspaces) {
|
||||
if (ws.productId === productId) {
|
||||
promises.push(updateEmployeeAccount(account, ws.workspace, ws.productId))
|
||||
}
|
||||
}
|
||||
await Promise.all(promises)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user