mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-19 14:55:31 +00: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");
|
// 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
|
// you may not use this file except in compliance with the License. You may
|
||||||
@ -660,14 +660,12 @@ export async function changeName (db: Db, productId: string, token: string, firs
|
|||||||
|
|
||||||
const workspaces = await db
|
const workspaces = await db
|
||||||
.collection<Workspace>(WORKSPACE_COLLECTION)
|
.collection<Workspace>(WORKSPACE_COLLECTION)
|
||||||
.find({ _id: { $in: account.workspaces } })
|
.find(withProductId(productId, { _id: { $in: account.workspaces } }))
|
||||||
.toArray()
|
.toArray()
|
||||||
|
|
||||||
const promises: Promise<void>[] = []
|
const promises: Promise<void>[] = []
|
||||||
for (const ws of workspaces) {
|
for (const ws of workspaces) {
|
||||||
if (ws.productId === productId) {
|
promises.push(updateEmployeeAccount(account, ws.workspace, ws.productId))
|
||||||
promises.push(updateEmployeeAccount(account, ws.workspace, ws.productId))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
await Promise.all(promises)
|
await Promise.all(promises)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user