fix(web): Domain.templateId опционален (Go omitempty), String() на error
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ async function req<T>(path: string, init?: RequestInit): Promise<T> {
|
|||||||
})
|
})
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
let msg = `HTTP ${res.status}`
|
let msg = `HTTP ${res.status}`
|
||||||
try { const b = await res.json(); if (b?.error) msg = b.error } catch { /* ignore */ }
|
try { const b = await res.json(); if (b?.error) msg = String(b.error) } catch { /* ignore */ }
|
||||||
throw new Error(msg)
|
throw new Error(msg)
|
||||||
}
|
}
|
||||||
if (res.status === 204) return undefined as T
|
if (res.status === 204) return undefined as T
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export interface Domain {
|
|||||||
providerAccountId: string
|
providerAccountId: string
|
||||||
zoneName: string
|
zoneName: string
|
||||||
zoneId: string
|
zoneId: string
|
||||||
templateId: string | null
|
templateId?: string | null // Go omitempty: поле может отсутствовать (undefined), а не null
|
||||||
}
|
}
|
||||||
export interface CreateDomainInput {
|
export interface CreateDomainInput {
|
||||||
providerAccountId: string
|
providerAccountId: string
|
||||||
|
|||||||
Reference in New Issue
Block a user