submit 'type' fixes

This commit is contained in:
makearmy 2025-09-28 18:54:16 -04:00
parent d331ca0e84
commit 667ecbf439

View file

@ -129,7 +129,12 @@ function useOptions(path: string) {
child = rows.find((r: any) => r?.field === full);
}
const choices: any[] = child?.meta?.options?.choices || [];
// ⟵ PATCH: read choices from nested child.options.choices first, then meta.options.choices
const choices: any[] =
(child?.options?.choices as any[]) ||
(child?.meta?.options?.choices as any[]) ||
[];
const mapped: Opt[] = choices.map((c: any) => ({
id: String(c.value ?? c.key ?? c.id),
label: String(c.text ?? c.label ?? c.name ?? c.value),