fix(state): changing species clears language, citizenship, and subspecies selections

This commit is contained in:
lew 2026-03-24 02:33:35 +00:00
parent 48f8b46827
commit c220815b89
20 changed files with 172 additions and 104 deletions

View file

@ -4,6 +4,7 @@ import { slugify } from './utils/slugify';
function zodForField(field: FieldDef): z.ZodTypeAny {
switch (field.type) {
case 'name':
case 'text':
case 'textarea':
case 'list':
@ -30,6 +31,7 @@ export function buildCharacterSchema(template: Template): z.ZodObject<Record<str
const shape: Record<string, z.ZodTypeAny> = {};
for (const record of template.records) {
for (const field of record.fields) {
if (field.type === 'separator') continue;
shape[slugify(field.label)] = zodForField(field);
}
}