fix: course creation form validations
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
{{ resume.file_name }}
|
||||
</span>
|
||||
<span class="text-sm text-gray-500 mt-1">
|
||||
{{ getFileSize() }}
|
||||
{{ getFileSize(resume.file_size) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,7 +67,7 @@
|
||||
import { Dialog, FileUploader, Button, createResource } from 'frappe-ui'
|
||||
import { FileText } from 'lucide-vue-next'
|
||||
import { ref, inject, defineModel } from 'vue'
|
||||
import { createToast } from '@/utils/'
|
||||
import { createToast, getFileSize } from '@/utils/'
|
||||
|
||||
const resume = ref(null)
|
||||
const show = defineModel()
|
||||
@@ -87,16 +87,6 @@ const validateFile = (file) => {
|
||||
}
|
||||
}
|
||||
|
||||
const getFileSize = () => {
|
||||
let value = parseInt(resume.value.file_size)
|
||||
if (value > 1048576) {
|
||||
return (value / 1048576).toFixed(2) + 'M'
|
||||
} else if (value > 1024) {
|
||||
return (value / 1024).toFixed(2) + 'K'
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
const jobApplication = createResource({
|
||||
url: 'frappe.client.insert',
|
||||
makeParams(values) {
|
||||
|
||||
@@ -48,6 +48,7 @@ import { sessionStore } from '@/stores/session'
|
||||
import { Dropdown } from 'frappe-ui'
|
||||
import { ChevronDown, LogIn, LogOut, User } from 'lucide-vue-next'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { convertToTitleCase } from '../utils'
|
||||
|
||||
const router = useRouter()
|
||||
const props = defineProps({
|
||||
@@ -94,18 +95,4 @@ const userDropdownOptions = [
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
function convertToTitleCase(str) {
|
||||
if (!str) {
|
||||
return ''
|
||||
}
|
||||
|
||||
return str
|
||||
.toLowerCase()
|
||||
.split(' ')
|
||||
.map(function (word) {
|
||||
return word.charAt(0).toUpperCase().concat(word.substr(1))
|
||||
})
|
||||
.join(' ')
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user