submit 'type' fixes

This commit is contained in:
makearmy 2025-09-29 00:06:39 -04:00
parent 6eb666c004
commit e9ae08d725

View file

@ -33,6 +33,7 @@ function useOptions(path: string) {
const m = String(v).match(/(\d+(\.\d+)?)/);
return m ? Number(m[1]) : null;
};
const nmRangeFor = (target?: string | null): [number, number] | null => {
if (!target) return null;
const t = target.toLowerCase();
@ -107,7 +108,6 @@ function useOptions(path: string) {
});
};
}
} else if (rawPath === "repeater-choices") {
// target=<collection>, group=<repeater field>, field=<child field>
const group = params.get("group") || "";
@ -131,9 +131,7 @@ function useOptions(path: string) {
// Choices can live on child.options.choices or child.meta.options.choices
const choices: any[] =
(child?.options?.choices as any[]) ??
(child?.meta?.options?.choices as 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),
@ -147,12 +145,6 @@ function useOptions(path: string) {
setLoading(false);
}
return; // short-circuit
} else {
// unknown path → empty
setOpts([]);
setLoading(false);
return;
} else {
// unknown path → empty
setOpts([]);