MCPcopy Create free account
hub / github.com/TAMustafa/Local_Chat_RAG / uploadFile

Function uploadFile

frontend/src/api/filesApi.ts:3–14  ·  view source on GitHub ↗
(file: File)

Source from the content-addressed store, hash-verified

1import axios from 'axios';
2
3export const uploadFile = async (file: File) => {
4 try {
5 const formData = new FormData();
6 formData.append('file', file);
7 const response = await axios.post('/api/upload', formData, {
8 headers: { 'Content-Type': 'multipart/form-data' },
9 });
10 return response.data;
11 } catch (error: any) {
12 throw error?.response?.data?.detail || 'File upload failed';
13 }
14};
15
16export const fetchFiles = async () => {
17 try {

Callers 1

useFileUploadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected