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