feat(documents) : bouton reload explorateur + liaison d'un fichier du partage SMB à un ticket

This commit is contained in:
Matthieu
2026-06-12 15:23:56 +02:00
parent 0f1eeeba1c
commit 73a34ef438
12 changed files with 472 additions and 42 deletions
+10 -1
View File
@@ -31,6 +31,15 @@ export function useTaskDocumentService() {
return uploadWithRelation('task', `/api/tasks/${taskId}`, file)
}
async function linkShare(taskId: number, sharePath: string): Promise<TaskDocument> {
return $fetch<TaskDocument>(`${baseURL}/task_documents`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ task: `/api/tasks/${taskId}`, sharePath }),
credentials: 'include',
})
}
async function remove(id: number): Promise<void> {
await api.delete(`/task_documents/${id}`, {}, {
toastSuccessKey: 'taskDocuments.deleted',
@@ -48,5 +57,5 @@ export function useTaskDocumentService() {
})
}
return { getByTask, upload, remove, getDownloadUrl, getContent }
return { getByTask, upload, linkShare, remove, getDownloadUrl, getContent }
}