another scan lens fix
This commit is contained in:
parent
50723718e4
commit
b8028c0be9
1 changed files with 4 additions and 2 deletions
|
|
@ -91,15 +91,17 @@ function useOptions(path: string) {
|
|||
url = `${API}/items/laser_focus_lens?fields=id,name&limit=1000&sort=name`;
|
||||
normalize = (rows) => rows.map((r) => ({ id: String(r.id), label: String(r.name ?? r.id) }));
|
||||
} else {
|
||||
url = `${API}/items/laser_scan_lens?fields=id,name,field_size,focal_length&limit=1000&sort=name`;
|
||||
// SCAN LENSES (fiber, uv, co2-galvo): no `name` field in this collection
|
||||
url = `${API}/items/laser_scan_lens?fields=id,field_size,focal_length&limit=1000&sort=focal_length`;
|
||||
normalize = (rows) =>
|
||||
rows.map((r) => {
|
||||
const fs = r.field_size != null ? `${r.field_size}` : "";
|
||||
const fl = r.focal_length != null ? `${r.focal_length}` : "";
|
||||
const composed = r.name ?? [fs && `${fs} mm`, fl && `${fl} mm`].filter(Boolean).join(" — ");
|
||||
const composed = [fs && `${fs} mm`, fl && `${fl} mm`].filter(Boolean).join(" — ");
|
||||
return { id: String(r.id), label: composed || String(r.id) };
|
||||
});
|
||||
}
|
||||
|
||||
} else if (rawPath === "repeater-choices") {
|
||||
// reads from fields meta: target=<collection>, group=<repeater>, field=<subfield>
|
||||
const group = params.get("group") || "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue