Skip to content

Commit

Permalink
feat: whitelist file types in file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Jan 16, 2024
1 parent 5cf75e8 commit 88ef469
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Components/Patient/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,7 @@ export const FileUpload = (props: FileUploadProps) => {
name: filename,
associating_id: getAssociatedId(),
file_category: category,
mime_type: f?.type,
};
dispatch(createUpload(requestData))
.then(uploadfile)
Expand Down Expand Up @@ -1105,6 +1106,7 @@ export const FileUpload = (props: FileUploadProps) => {
name: filename,
associating_id: getAssociatedId(),
file_category: category,
mime_type: "audio/mpeg",
};
dispatch(createUpload(requestData))
.then(uploadAudiofile)
Expand Down Expand Up @@ -1532,6 +1534,7 @@ export const FileUpload = (props: FileUploadProps) => {
title="changeFile"
onChange={onFileChange}
type="file"
accept="image/jpeg,image/png,application/pdf"
hidden
/>
</label>
Expand Down

0 comments on commit 88ef469

Please sign in to comment.