Skip to content
Snippets Groups Projects
Unverified Commit 22c8b83d authored by Samuel Couillard's avatar Samuel Couillard Committed by GitHub
Browse files

Fix Document Upload (#4798)

parent 6641823b
No related branches found
No related tags found
No related merge requests found
export const fileValidation = (file, type) => {
const IMAGE_MAX_FILE_SIZE = 3_000_000;
const IMAGE_SUPPORTED_FORMATS = 'image/jpeg|image/png|image/svg';
const IMAGE_SUPPORTED_FORMATS = ['image/jpeg', 'image/png', 'image/svg'];
const PRESENTATION_MAX_FILE_SIZE = 10_000_000;
const PRESENTATION_SUPPORTED_FORMATS = [
......@@ -23,7 +23,7 @@ export const fileValidation = (file, type) => {
if (file.size > MAX_FILE_SIZE) {
throw new Error('fileSizeTooLarge');
} else if (!file.type.match(SUPPORTED_FORMATS)) {
} else if (!SUPPORTED_FORMATS.includes(file.type)) {
throw new Error('fileTypeNotSupported');
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment