submit formatting fixes for build

This commit is contained in:
makearmy 2025-09-28 17:45:12 -04:00
parent 5b33551e60
commit 98ae049804

View file

@ -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=<collection>, group=<repeater field>, field=<child 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),