Agently / web /src /api /documents.js
CI Deploy
Deploy 2026-05-15 14:25 UTC
7949d20
Raw
History Blame Contribute Delete
565 Bytes
import { get, del, uploadFile } from './client.js'
export async function loadDocumentsFromApi(convId) {
try {
return await get(`/api/documents?conversation_id=${convId}`)
} catch {
return []
}
}
export async function uploadDocumentToApi(file, convId) {
try {
return await uploadFile('/api/documents/upload', file, { conversation_id: convId })
} catch {
return null
}
}
export async function deleteDocumentFromApi(docId, convId) {
try {
await del(`/api/documents/${docId}?conversation_id=${convId}`)
} catch { /* ignore */ }
}