refactor: updated the validateFile function in utils and reused it
This commit is contained in:
@@ -151,7 +151,7 @@ import { computed, onMounted, reactive, inject } from 'vue'
|
||||
import { FileText, X } from 'lucide-vue-next'
|
||||
import { sessionStore } from '@/stores/session'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { getFileSize } from '@/utils'
|
||||
import { getFileSize, validateFile } from '@/utils'
|
||||
|
||||
const user = inject('$user')
|
||||
const router = useRouter()
|
||||
@@ -293,14 +293,6 @@ const removeImage = () => {
|
||||
job.image = null
|
||||
}
|
||||
|
||||
const validateFile = (file) => {
|
||||
if (!file.type.startsWith('image/')) {
|
||||
const errorMessage = __('Only image file is allowed.')
|
||||
toast.error(errorMessage)
|
||||
return errorMessage
|
||||
}
|
||||
}
|
||||
|
||||
const jobTypes = computed(() => {
|
||||
return [
|
||||
{ label: 'Full Time', value: 'Full Time' },
|
||||
|
||||
Reference in New Issue
Block a user