first fixes
This commit is contained in:
@@ -5,10 +5,10 @@ import { Link, usePage } from '@inertiajs/vue3'
|
||||
const { props } = usePage<{
|
||||
components: any[]
|
||||
states: any[]
|
||||
errors: any[]
|
||||
errors: Record<string, string>
|
||||
}>()
|
||||
const { components, states } = props
|
||||
const errors = computed(() => props.errors || [])
|
||||
const errors = computed(() => props.errors || {})
|
||||
|
||||
const componentTypeOrder = [
|
||||
'Processor',
|
||||
@@ -49,8 +49,7 @@ const form = reactive({
|
||||
})
|
||||
|
||||
function getErrorMessage(field: string): string | null {
|
||||
const error = errors.value.find((error) => error.field === field)
|
||||
return error ? error.message : null
|
||||
return errors.value[field] || null
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user