get back to stable

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-10-08 12:29:02 +02:00
parent 157e7874c4
commit fc13903163
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0

View File

@ -80,22 +80,26 @@
const id = dragCard._id
const txes: TxCUD<Doc>[] = []
if (dragCardInitialState !== state)
client.updateDoc(_class, space, id, { state })
if (dragCardInitialPosition !== to) {
txes.push(client.txFactory.createTxUpdateDoc(core.class.SpaceWithStates, core.space.Model, space, {
await client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
$pull: {
order: id
}
}))
})
txes.push(client.txFactory.createTxUpdateDoc(core.class.SpaceWithStates, core.space.Model, space, {
client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
$push: {
order: {
$each: [id],
$position: to
}
}
}))
})
// await client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
// $pull: {
@ -113,13 +117,10 @@
// })
}
if (dragCardInitialState !== state)
txes.push(client.txFactory.createTxUpdateDoc(_class, space, id, { state }))
if (txes.length > 0) {
const updateTx = client.txFactory.createTxBulkWrite(space, txes)
await client.tx(updateTx)
}
// if (txes.length > 0) {
// const updateTx = client.txFactory.createTxBulkWrite(space, txes)
// await client.tx(updateTx)
// }
}
function getValue(doc: Doc, key: string): any {