1
0

feature/remove-attachment-upload-mixin (#724)

Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/724
Reviewed-by: konrad <k@knt.li>
Co-authored-by: dpschen <dpschen@noreply.kolaente.de>
Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
This commit is contained in:
dpschen
2021-09-24 18:16:37 +00:00
committed by konrad
parent 4f2378ff02
commit 41331c8a86
7 changed files with 54 additions and 59 deletions

View File

@ -138,19 +138,16 @@
import AttachmentService from '../../../services/attachment'
import AttachmentModel from '../../../models/attachment'
import User from '../../misc/user'
import attachmentUpload from '@/components/tasks/mixins/attachmentUpload'
import {generateAttachmentUrl} from '@/helpers/generateAttachmentUrl'
import {mapState} from 'vuex'
import copy from 'copy-to-clipboard'
import { uploadFiles, generateAttachmentUrl } from '@/helpers/attachments'
export default {
name: 'attachments',
components: {
User,
},
mixins: [
attachmentUpload,
],
data() {
return {
attachmentService: AttachmentService,
@ -221,7 +218,7 @@ export default {
this.uploadFiles(this.$refs.files.files)
},
uploadFiles(files) {
this.createAttachment(this.attachmentService, files)
uploadFiles(this.attachmentService, this.taskId, files)
},
deleteAttachment() {
this.attachmentService

View File

@ -151,9 +151,9 @@
<script>
import TaskCommentService from '../../../services/taskComment'
import TaskCommentModel from '../../../models/taskComment'
import attachmentUpload from '../mixins/attachmentUpload'
import LoadingComponent from '../../misc/loading'
import ErrorComponent from '../../misc/error'
import { uploadFile } from '@/helpers/attachments'
export default {
name: 'comments',
@ -165,7 +165,6 @@ export default {
timeout: 60000,
}),
},
mixins: [attachmentUpload],
props: {
taskId: {
type: Number,
@ -222,6 +221,10 @@ export default {
},
},
methods: {
attachmentUpload(...args) {
return uploadFile(this.taskId, ...args)
},
loadComments() {
this.taskCommentService
.getAll({taskId: this.taskId})