diff --git a/models/card/src/actions.ts b/models/card/src/actions.ts index 0ffb6c4e7f0..8023ffd44d1 100644 --- a/models/card/src/actions.ts +++ b/models/card/src/actions.ts @@ -218,6 +218,7 @@ export function createActions (builder: Builder): void { createAction(builder, { ...actionTemplates.move, + input: 'any', target: card.class.Card, context: { mode: ['context', 'browser'], diff --git a/plugins/view-resources/src/components/Move.svelte b/plugins/view-resources/src/components/Move.svelte index d853e9628a8..1c9f9497870 100644 --- a/plugins/view-resources/src/components/Move.svelte +++ b/plugins/view-resources/src/components/Move.svelte @@ -48,7 +48,7 @@ $: _class && translate(_class, {}, $themeStore.language).then((res) => (classLabel = res.toLocaleLowerCase())) async function move (doc: Doc): Promise { - const op = client.apply(doc._id, 'move-to-space') + const op = client.apply(undefined, 'move-to-space') const needRank = currentSpace ? hierarchy.isDerived(currentSpace._class, task.class.Project) : false if (needRank) { const lastOne = await client.findOne((doc as Task)._class, { space }, { sort: { rank: SortingOrder.Descending } }) @@ -59,16 +59,17 @@ await moveToSpace(op, doc, space) } await op.commit() - - dispatch('close') } const moveAll = async (): Promise => { - await Promise.all( - docs.map(async (doc) => { + for (const doc of docs) { + try { await move(doc) - }) - ) + } catch (err) { + console.error(err) + } + } + dispatch('close') } async function getSpace (): Promise {