From 901e7818030dcd4e3da67909aba4843daab3b62e Mon Sep 17 00:00:00 2001 From: Andrey Platov Date: Sat, 9 Oct 2021 13:35:59 +0200 Subject: [PATCH] use `$move` Signed-off-by: Andrey Platov --- .../src/components/EditStatuses.svelte | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/plugins/workbench-resources/src/components/EditStatuses.svelte b/plugins/workbench-resources/src/components/EditStatuses.svelte index 7b58f612f6..f488cc7e63 100644 --- a/plugins/workbench-resources/src/components/EditStatuses.svelte +++ b/plugins/workbench-resources/src/components/EditStatuses.svelte @@ -78,15 +78,10 @@ async function move(to: number) { client.updateDoc(core.class.SpaceWithStates, core.space.Model, _id, { - $pull: { - states: dragState - } - }) - client.updateDoc(core.class.SpaceWithStates, core.space.Model, _id, { - $push: { + $move: { states: { - $each: [dragState], - $position: to < dragStateInitialPosition ? to : to + $value: dragState, + $position: to } } })