feat: remove file type validation from file upload component
This commit is contained in:
@@ -65,18 +65,6 @@ async function onFileChange(event: Event, handleChange: (value: any) => void) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate file type if accept is specified
|
|
||||||
if (props.accept) {
|
|
||||||
const acceptedTypes = Array.isArray(props.accept) ? props.accept.map((ext) => `image/${ext}`) : [props.accept]
|
|
||||||
if (!acceptedTypes.includes(file.type)) {
|
|
||||||
console.warn(`File type not allowed: ${file.type}`)
|
|
||||||
handleChange(null)
|
|
||||||
emit('update:modelValue', null)
|
|
||||||
emit('fileSelected', null)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handleChange(file)
|
handleChange(file)
|
||||||
emit('update:modelValue', file)
|
emit('update:modelValue', file)
|
||||||
emit('fileSelected', file)
|
emit('fileSelected', file)
|
||||||
|
|||||||
Reference in New Issue
Block a user