submit 'type' fixes
This commit is contained in:
parent
6eb666c004
commit
e9ae08d725
1 changed files with 2 additions and 10 deletions
|
|
@ -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([]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue