mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 00:10:37 +00:00
get back to stable
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
157e7874c4
commit
fc13903163
@ -80,22 +80,26 @@
|
|||||||
const id = dragCard._id
|
const id = dragCard._id
|
||||||
const txes: TxCUD<Doc>[] = []
|
const txes: TxCUD<Doc>[] = []
|
||||||
|
|
||||||
|
if (dragCardInitialState !== state)
|
||||||
|
client.updateDoc(_class, space, id, { state })
|
||||||
|
|
||||||
|
|
||||||
if (dragCardInitialPosition !== to) {
|
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: {
|
$pull: {
|
||||||
order: id
|
order: id
|
||||||
}
|
}
|
||||||
}))
|
})
|
||||||
|
|
||||||
txes.push(client.txFactory.createTxUpdateDoc(core.class.SpaceWithStates, core.space.Model, space, {
|
client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
|
||||||
$push: {
|
$push: {
|
||||||
order: {
|
order: {
|
||||||
$each: [id],
|
$each: [id],
|
||||||
$position: to
|
$position: to
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}))
|
})
|
||||||
|
|
||||||
// await client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
|
// await client.updateDoc(core.class.SpaceWithStates, core.space.Model, space, {
|
||||||
// $pull: {
|
// $pull: {
|
||||||
@ -113,13 +117,10 @@
|
|||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dragCardInitialState !== state)
|
// if (txes.length > 0) {
|
||||||
txes.push(client.txFactory.createTxUpdateDoc(_class, space, id, { state }))
|
// 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 {
|
function getValue(doc: Doc, key: string): any {
|
||||||
|
Loading…
Reference in New Issue
Block a user