chore(admin-ui): fix pre-existing TypeScript errors

5 ошибок TS, накопленных за прошлые итерации — теперь pnpm tsc зелёный:

- SchemaDrivenForm: убран unused import formatIsoDateTime + unused
  prop `path` (передавался в FieldRenderer, но FieldRendererProps его
  не объявлял и FieldBody не использовал)
- dictionaries.$name: удалена неиспользуемая функция toIsoDate
- api/client.ts: добавлен `$schema?: string` в JsonSchema type
  (используется в buildSchemaJson и тестируется в types.test.ts)
This commit is contained in:
Zimin A.N.
2026-05-06 13:22:17 +03:00
parent 3f2a6b5d53
commit 9b20cbf9b9
3 changed files with 1 additions and 13 deletions
+1
View File
@@ -41,6 +41,7 @@ export type DictionaryDefinition = {
}
export type JsonSchema = {
$schema?: string
type?: string
title?: string
description?: string
@@ -25,7 +25,6 @@ import {
combineDateTime,
extractTime,
formatIsoDate,
formatIsoDateTime,
parseFormDate,
} from '@/lib/dates'
@@ -217,7 +216,6 @@ export const SchemaDrivenForm = ({
<FieldRenderer
key={key}
fieldKey={key}
path={`data.${key}`}
schema={properties[key]}
required={required.has(key)}
control={control}
@@ -236,7 +234,6 @@ export const SchemaDrivenForm = ({
<FieldRenderer
key={key}
fieldKey={key}
path={`data.${key}`}
schema={properties[key]}
required={required.has(key)}
control={control}
@@ -255,7 +252,6 @@ export const SchemaDrivenForm = ({
<FieldRenderer
key={key}
fieldKey={key}
path={`data.${key}`}
schema={properties[key]}
required={required.has(key)}
control={control}
@@ -344,15 +344,6 @@ function DictionaryDetail() {
)
}
const toIsoDate = (iso: string | undefined): string => {
if (!iso) return ''
const d = new Date(iso)
if (isNaN(d.getTime())) return ''
if (d.getFullYear() >= 9999) return ''
const pad = (n: number) => String(n).padStart(2, '0')
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
}
const serverErrorMessage = (err: unknown): string | null => {
if (!err) return null
if (axios.isAxiosError(err)) {