mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 16:27:22 +00:00
use $move
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
8ba32cc38f
commit
901e781803
@ -78,15 +78,10 @@
|
|||||||
|
|
||||||
async function move(to: number) {
|
async function move(to: number) {
|
||||||
client.updateDoc(core.class.SpaceWithStates, core.space.Model, _id, {
|
client.updateDoc(core.class.SpaceWithStates, core.space.Model, _id, {
|
||||||
$pull: {
|
$move: {
|
||||||
states: dragState
|
|
||||||
}
|
|
||||||
})
|
|
||||||
client.updateDoc(core.class.SpaceWithStates, core.space.Model, _id, {
|
|
||||||
$push: {
|
|
||||||
states: {
|
states: {
|
||||||
$each: [dragState],
|
$value: dragState,
|
||||||
$position: to < dragStateInitialPosition ? to : to
|
$position: to
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user