Merge branch 'vue3' into feature/vue3-async-await
This commit is contained in:
commit
9fc158831b
1 changed files with 4 additions and 5 deletions
|
@ -236,6 +236,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import draggable from 'vuedraggable'
|
import draggable from 'vuedraggable'
|
||||||
|
import cloneDeep from 'lodash.clonedeep'
|
||||||
|
|
||||||
import BucketModel from '../../../models/bucket'
|
import BucketModel from '../../../models/bucket'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
@ -421,11 +422,9 @@ export default {
|
||||||
const taskBefore = newBucket.tasks[e.newIndex - 1] ?? null
|
const taskBefore = newBucket.tasks[e.newIndex - 1] ?? null
|
||||||
const taskAfter = newBucket.tasks[e.newIndex + 1] ?? null
|
const taskAfter = newBucket.tasks[e.newIndex + 1] ?? null
|
||||||
|
|
||||||
const newTask = {
|
const newTask = cloneDeep(task) // cloning the task to avoid vuex store mutations
|
||||||
...task,
|
newTask.bucketId = newBucket.id,
|
||||||
bucketId: newBucket.id,
|
newTask.kanbanPosition = calculateItemPosition(taskBefore !== null ? taskBefore.kanbanPosition : null, taskAfter !== null ? taskAfter.kanbanPosition : null),
|
||||||
kanbanPosition: calculateItemPosition(taskBefore !== null ? taskBefore.kanbanPosition : null, taskAfter !== null ? taskAfter.kanbanPosition : null),
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch('tasks/update', newTask)
|
await this.$store.dispatch('tasks/update', newTask)
|
||||||
|
|
Loading…
Reference in a new issue