fix: empty changeset must serialize as [] not null (white-screen after snapshot)

toChangesetResponse initialises updates/prunes/readOnly so a zone matching
its template exactly (e.g. right after 'create template from zone') marshals
arrays, not null. DiffView/DomainDiffPage also normalise null defensively.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwxdSt4reTm7Dj1oxRvpP3
This commit is contained in:
2026-07-05 13:10:08 +07:00
parent 08697e06d7
commit bc2e77ad4e
5 changed files with 47 additions and 6 deletions
+2 -2
View File
@@ -41,8 +41,8 @@ export function DomainDiffPage() {
const pruneCheckboxId = useId()
const changeset = check.data
const hasPrunes = (changeset?.prunes.length ?? 0) > 0
const hasUpdates = (changeset?.updates.length ?? 0) > 0
const hasPrunes = (changeset?.prunes?.length ?? 0) > 0
const hasUpdates = (changeset?.updates?.length ?? 0) > 0
const pruneWarning = applyPrunes && hasPrunes
const recordList = zoneRecords.data ?? []