fix: TS errors, serialize calls, unused imports, pre-commit hook
This commit is contained in:
@@ -9,7 +9,6 @@ const { props } = usePage<{
|
||||
errors: Record<string, string>
|
||||
}>()
|
||||
const { components, states } = props
|
||||
const errors = computed(() => props.errors || {})
|
||||
|
||||
const componentTypeOrder = [
|
||||
'Processor',
|
||||
@@ -48,10 +47,6 @@ const form = reactive({
|
||||
globalScore: 0,
|
||||
componentsId: [] as number[],
|
||||
})
|
||||
|
||||
function getErrorMessage(field: string): string | null {
|
||||
return errors.value[field] || null
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive } from 'vue'
|
||||
import { reactive } from 'vue'
|
||||
import { Link } from '@adonisjs/inertia/vue'
|
||||
import { router, usePage } from '@inertiajs/vue3'
|
||||
|
||||
@@ -9,8 +9,7 @@ const { props } = usePage<{
|
||||
states: any[]
|
||||
errors?: Record<string, string>
|
||||
}>()
|
||||
const { computer, availableComponents, states } = props
|
||||
const errors = computed(() => props.errors || {})
|
||||
const { computer, states } = props
|
||||
|
||||
const form = reactive({
|
||||
id: computer.id,
|
||||
@@ -23,17 +22,9 @@ const form = reactive({
|
||||
componentsId: computer.components.map((c: any) => c.id),
|
||||
})
|
||||
|
||||
function updateComponents(componentsId: number[]) {
|
||||
form.componentsId = componentsId
|
||||
}
|
||||
|
||||
function deleteComputer(id: number) {
|
||||
router.delete(`/computers/${id}`)
|
||||
}
|
||||
|
||||
function getErrorMessage(field: string): string | null {
|
||||
return errors.value[field] || null
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Link } from '@adonisjs/inertia/vue'
|
||||
|
||||
const { props } = defineProps<{ computer: any }>()
|
||||
const { computer } = defineProps<{ computer: any }>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user