MCPcopy Create free account
hub / github.com/SensAI-PT/RAGMeUp / uploadDocuments

Function uploadDocuments

ui/node-react/client/src/api.js:171–186  ·  view source on GitHub ↗
(files, dataset)

Source from the content-addressed store, hash-verified

169}
170
171export async function uploadDocuments(files, dataset) {
172 const formData = new FormData();
173 for (const file of files) {
174 formData.append('files', file);
175 }
176 formData.append('dataset', dataset);
177
178 const res = await fetch(`${API_BASE}/documents/upload`, {
179 method: 'POST',
180 headers: getAuthHeaders(),
181 body: formData,
182 });
183 const data = await res.json();
184 if (!res.ok) throw new Error(data.error || 'Upload failed');
185 return data;
186}
187
188export async function downloadDocument(filename) {
189 const res = await fetch(`${API_BASE}/documents/download/${encodeURIComponent(filename)}`, {

Callers 1

handleUploadFunction · 0.85

Calls 1

getAuthHeadersFunction · 0.85

Tested by

no test coverage detected