3a7a4bdc42
# Conflicts: # src/components/input/editor.vue # src/components/list/partials/filters.vue # src/components/tasks/partials/editAssignees.vue # src/helpers/find.ts # src/helpers/time/formatDate.js # src/main.ts # src/store/modules/attachments.js # src/store/modules/kanban.js # src/views/list/views/List.vue # yarn.lock
23 lines
No EOL
564 B
JavaScript
23 lines
No EOL
564 B
JavaScript
import {findIndexById} from '@/helpers/utils'
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state: () => ({
|
|
attachments: [],
|
|
}),
|
|
mutations: {
|
|
set(state, attachments) {
|
|
console.debug('Set attachments', attachments)
|
|
state.attachments = attachments
|
|
},
|
|
add(state, attachment) {
|
|
console.debug('Add attachement', attachment)
|
|
state.attachments.push(attachment)
|
|
},
|
|
removeById(state, id) {
|
|
const attachmentIndex = findIndexById(state.attachments, id)
|
|
state.attachments.splice(attachmentIndex, 1)
|
|
console.debug('Remove attachement', id)
|
|
},
|
|
},
|
|
} |