@eleva-io/erp-sdk
Version:
SDK oficial para el ERP de Eleva
29 lines • 931 B
JavaScript
export class MeetingDocumentsAPI {
_httpClient;
_basePath;
constructor(_httpClient, _basePath) {
this._httpClient = _httpClient;
this._basePath = _basePath;
}
async find(query) {
return this._httpClient.get(this._basePath, {
query,
});
}
async download(documentId) {
return this._httpClient.get(`${this._basePath}/${documentId}/download`, {
responseType: 'blob',
});
}
async createAttachment(file) {
const formData = new FormData();
formData.append('file', file);
return this._httpClient.post(`${this._basePath.replace('/documents', '/attachments')}`, {
body: formData,
});
}
async deleteAttachment(documentId) {
return this._httpClient.delete(`${this._basePath.replace('/documents', '/attachments')}/${documentId}`);
}
}
//# sourceMappingURL=documents.js.map