mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-23 22:12:44 +03:00
Fix model when clone ws (#3395)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
a2463cd69c
commit
de1dc72c99
@ -172,7 +172,13 @@ export abstract class MemDb extends TxProcessor implements Storage {
|
||||
|
||||
addDoc (doc: Doc): void {
|
||||
this.hierarchy.getAncestors(doc._class).forEach((_class) => {
|
||||
this.getObjectsByClass(_class).push(doc)
|
||||
const arr = this.getObjectsByClass(_class)
|
||||
const index = arr.findIndex((p) => p._id === doc._id)
|
||||
if (index === -1) {
|
||||
arr.push(doc)
|
||||
} else {
|
||||
arr[index] = doc
|
||||
}
|
||||
})
|
||||
this.objectById.set(doc._id, doc)
|
||||
}
|
||||
|
@ -573,6 +573,7 @@ export async function createWorkspace (
|
||||
if (initWS !== undefined) {
|
||||
if ((await getWorkspace(db, productId, initWS)) !== null) {
|
||||
await cloneWorkspace(getTransactor(), getWorkspaceId(initWS, productId), getWorkspaceId(workspace, productId))
|
||||
await upgradeModel(getTransactor(), getWorkspaceId(workspace, productId), txes, migrationOperation)
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user