diff --git a/src/app/components/portfolio/UploadCsvModal.tsx b/src/app/components/portfolio/UploadCsvModal.tsx index 2a619e4..cb41cf2 100644 --- a/src/app/components/portfolio/UploadCsvModal.tsx +++ b/src/app/components/portfolio/UploadCsvModal.tsx @@ -39,10 +39,10 @@ async function uploadCsvToS3({ presignedUrl: string; file: File; }) { - console.log("Uploading file to s3"); const upload = await fetch(presignedUrl, { method: "PUT", body: file, + headers: { "Content-Type": "text/csv" }, }); if (!upload.ok) { @@ -64,7 +64,7 @@ export const SubmitPlan = ({ goal: string; housingType: string; goalValue: string; - file: File | null; + file: File; portfolioId: number; }) => { const router = useRouter(); @@ -87,6 +87,7 @@ export const SubmitPlan = ({ const { mutate, isLoading } = useMutation(generatePresignedUrl, { onSuccess: (data) => { + console.log("Got url: ", data.url); // After the presigned URL has been generated, we can upload the file to S3 mutateUploadCsv({ presignedUrl: data.url, file: file }); },