diff --git a/frontend/src/pages/Upload.tsx b/frontend/src/pages/Upload.tsx index fc3b243..db1ad3d 100644 --- a/frontend/src/pages/Upload.tsx +++ b/frontend/src/pages/Upload.tsx @@ -7,20 +7,22 @@ import StatsStyling from "../styles/stats_styling"; const styles = StatsStyling; const UploadPage = () => { - let postFile: File | undefined - let commentFile: File | undefined + let postFile: File | undefined; + let commentFile: File | undefined; + let topicBucketFile: File | undefined; const [returnMessage, setReturnMessage] = useState('') const navigate = useNavigate() const uploadFiles = async () => { - if (!postFile || !commentFile) { - alert('Please select both files before uploading.') + if (!postFile || !commentFile || !topicBucketFile) { + alert('Please upload all files before uploading.') return } const formData = new FormData() formData.append('posts', postFile) formData.append('comments', commentFile) + formData.append('topics', topicBucketFile) try { const response = await axios.post('http://localhost:5000/upload', formData, { @@ -40,11 +42,15 @@ const UploadPage = () => {