Renaming a person keeps the chart and its analyses
CI / test (push) Successful in 47s
CI / build (push) Successful in 3m55s
CI / deploy (push) Skipped

The person edit form sent the birth data with every save, so a new name alone
recalculated the chart, deleted its analyses and comparisons and queued a new
summary. Now the backend ignores birth data equal to the stored one (and keeps
everything when a recalculation gives the same chart), and the form sends it
only when it changed. The name can be changed after the correction window too
("Átnevezés" on the person card).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-17 16:59:18 +00:00
co-authored by Claude Opus 5.5
parent e004ea696b
commit b53cadcd8c
7 changed files with 140 additions and 20 deletions
+10 -1
View File
@@ -69,10 +69,19 @@ export function BirthForm({
geonames_id: place.geonames_id,
...(ambiguous ? { ambiguous_time: ambiguity } : {}),
};
// Correcting a person: the birth data only when it changed, so a new
// name alone does not recalculate the chart or drop its analyses.
const birthChanged =
!initial ||
ambiguous ||
date !== initial.date ||
(timeUnknown ? null : time) !== (initial.time?.slice(0, 5) ?? null) ||
country !== (initial.country ?? "HU") ||
place.geonames_id !== initial.geonames_id;
const saved = person?.chartId
? await api<{ id: string }>(`/charts/${person.chartId}`, {
method: "PATCH",
body: { label: name.trim(), birth },
body: birthChanged ? { label: name.trim(), birth } : { label: name.trim() },
})
: await api<{ id: string }>("/charts", {
body: person