MCPcopy Create free account
hub / github.com/ShipSecAI/studio / handleUpload

Function handleUpload

frontend/src/components/workflow/FileUpload.tsx:25–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 };
24
25 const handleUpload = async () => {
26 if (!selectedFile) return;
27
28 setIsUploading(true);
29 setError(null);
30
31 try {
32 const result = await api.files.upload(selectedFile);
33 const fileId = (result as any).id;
34
35 setUploadedFileId(fileId);
36 onFileUploaded?.(fileId, selectedFile.name);
37 } catch (err) {
38 console.error('Failed to upload file:', err);
39 setError(err instanceof Error ? err.message : 'Failed to upload file');
40 } finally {
41 setIsUploading(false);
42 }
43 };
44
45 const handleClear = () => {
46 setSelectedFile(null);

Callers

nothing calls this directly

Calls 2

uploadMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected