first fixes

This commit is contained in:
Kevin
2026-06-29 22:48:59 +02:00
parent 184de52ad2
commit 66a97be5c6
25 changed files with 646 additions and 471 deletions
+3 -4
View File
@@ -6,10 +6,10 @@ const { props } = usePage<{
computer: any
availableComponents: any[]
states: any[]
errors?: any[]
errors?: Record<string, string>
}>()
const { computer, availableComponents, states } = props
const errors = computed(() => props.errors || [])
const errors = computed(() => props.errors || {})
const form = reactive({
id: computer.id,
@@ -31,8 +31,7 @@ function deleteComputer(id: number) {
}
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>