diff --git a/app/components/forms/SettingsSubmit.tsx b/app/components/forms/SettingsSubmit.tsx index 468b82f2..8fbaca1e 100644 --- a/app/components/forms/SettingsSubmit.tsx +++ b/app/components/forms/SettingsSubmit.tsx @@ -91,6 +91,7 @@ function useOptions(path: string) { url = `${API}/items/laser_focus_lens?fields=id,name&limit=1000`; normalize = (rows) => rows.map((r) => ({ id: String(r.id), label: String(r.name ?? r.id) })); } else { + // SCAN LENSES (fiber, uv, co2-galvo): collection has no `name`; sort numerically by focal_length url = `${API}/items/laser_scan_lens?fields=id,field_size,focal_length&limit=1000`; normalize = (rows) => { const toNum = (v: any) => { @@ -106,8 +107,6 @@ function useOptions(path: string) { }); }; } - } - } else if (rawPath === "repeater-choices") { // target=, group=, field= const group = params.get("group") || ""; @@ -119,14 +118,14 @@ function useOptions(path: string) { const metaJson = await metaRes.json(); const rows = metaJson?.data ?? []; - // find the repeater parent (e.g. "fill_settings" or "raster_settings") + // find the repeater parent (e.g. "fill_settings" / "line_settings" / "raster_settings") const parent = rows.find((r: any) => r?.field === group); const children = parent?.meta?.options?.fields || []; // Directus stores repeater children here // find the child definition (e.g. "type", "dither") const child = children.find((f: any) => f?.field === field); - // pull choices off the child's interface meta + // pull choices from the child interface meta const choices: any[] = child?.meta?.options?.choices || []; const mapped: Opt[] = choices.map((c: any) => ({ id: String(c.value ?? c.key ?? c.id),