feat(documents) : generalize TaskDocumentUpload and add upload zone to ticket detail modal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 19:42:43 +01:00
parent e16fd2053e
commit 7099f1ca95
2 changed files with 217 additions and 3 deletions

View File

@@ -49,14 +49,15 @@
import { useTaskDocumentService } from '~/services/task-documents'
const props = defineProps<{
taskId: number
taskId?: number
clientTicketId?: number
}>()
const emit = defineEmits<{
uploaded: []
}>()
const { upload: uploadFile } = useTaskDocumentService()
const { upload: uploadFile, uploadForTicket } = useTaskDocumentService()
const toast = useToast()
const { t } = useI18n()
@@ -109,7 +110,11 @@ async function processFiles(files: File[]) {
uploads.value.push(state)
try {
await uploadFile(props.taskId, file)
if (props.clientTicketId) {
await uploadForTicket(props.clientTicketId, file)
} else if (props.taskId) {
await uploadFile(props.taskId, file)
}
state.uploading = false
state.progress = 100
} catch {