important client fix

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-10-07 22:38:05 +02:00
parent 4a45a0b5fe
commit d89b8827ea
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
2 changed files with 23 additions and 22 deletions
packages/presentation/src
plugins/view-resources/src/components

View File

@ -39,7 +39,8 @@ class UIClient extends TxOperations implements Client {
}
tx(tx: Tx): Promise<void> {
return Promise.all([super.tx(tx), this.liveQuery.tx(tx)]) as unknown as Promise<void>
// return Promise.all([super.tx(tx), this.liveQuery.tx(tx)]) as unknown as Promise<void>
return super.tx(tx)
}
}

View File

@ -84,32 +84,13 @@
if (dragCardInitialPosition !== to) {
// const remove = client.txFactory.createTxUpdateDoc(core.class.SpaceWithStates, core.space.Model, space, {
// $pull: {
// order: id
// }
// })
// const add = client.txFactory.createTxUpdateDoc(core.class.SpaceWithStates, core.space.Model, space, {
// $push: {
// order: {
// $each: [id],
// $position: to
// }
// }
// })
// const updateTx = client.txFactory.createTxBulkWrite(core.space.Model, [remove, add])
// await client.tx(updateTx)
await client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
const remove = client.txFactory.createTxUpdateDoc(core.class.SpaceWithStates, core.space.Model, space, {
$pull: {
order: id
}
})
client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
const add = client.txFactory.createTxUpdateDoc(core.class.SpaceWithStates, core.space.Model, space, {
$push: {
order: {
$each: [id],
@ -117,6 +98,25 @@
}
}
})
const updateTx = client.txFactory.createTxBulkWrite(core.space.Model, [remove, add])
await client.tx(updateTx)
// await client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
// $pull: {
// order: id
// }
// })
// client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
// $push: {
// order: {
// $each: [id],
// $position: to
// }
// }
// })
}
}