fix: TS errors, serialize calls, unused imports, pre-commit hook
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive } from 'vue'
|
||||
import { reactive } from 'vue'
|
||||
import { Link } from '@adonisjs/inertia/vue'
|
||||
import { usePage } from '@inertiajs/vue3'
|
||||
import CustomSelect from '~/pages/widgets/CustomSelect.vue'
|
||||
@@ -11,7 +11,6 @@ const { props } = usePage<{
|
||||
errors?: Record<string, string>
|
||||
}>()
|
||||
const { component, types, origin } = props
|
||||
const errors = computed(() => props.errors || {})
|
||||
|
||||
const form = reactive({
|
||||
id: component.id,
|
||||
@@ -21,18 +20,6 @@ const form = reactive({
|
||||
purchaseDate: component.purchaseDate,
|
||||
origin: origin,
|
||||
})
|
||||
|
||||
function getErrorMessage(field: string): string | null {
|
||||
return errors.value[field] || null
|
||||
}
|
||||
|
||||
function formatDateForMySQL(date: string) {
|
||||
const d = new Date(date)
|
||||
const year = d.getFullYear()
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
form.purchase_date = `${year}-${month}-${day}`
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user