Skip to content

Commit

Permalink
fix: unable to upload add more image, changed format
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-helmy committed Jun 14, 2023
1 parent 0b474c0 commit e4e7eec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/AddSurauForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ const AddSurauForm: FC<AddSurauFormProps> = ({ setOpen }) => {
const { url } = await uploadToS3(file as File);

setImagePreviews([...imagePreviews as ImagePreviews[], URL.createObjectURL(file as Blob) as unknown as ImagePreviews]);
setFilePath([...filePath, url as unknown as FilePath]);
const cloudFrontFilePath = url.replace("https://ratemysurau.s3.ap-southeast-1.amazonaws.com/", "https://dcm2976bhgfsz.cloudfront.net/");
setFilePath([...filePath, { file_path: cloudFrontFilePath} as unknown as FilePath]);


}

const handleMallChange = (e: any) => {
Expand Down

0 comments on commit e4e7eec

Please sign in to comment.