diff --git a/app/components/forms/SettingsSubmit.tsx b/app/components/forms/SettingsSubmit.tsx index cfaf94f4..12b7aac3 100644 --- a/app/components/forms/SettingsSubmit.tsx +++ b/app/components/forms/SettingsSubmit.tsx @@ -107,13 +107,14 @@ function useOptions(path: string) { }); }; } + } else if (rawPath === "repeater-choices") { // target=, group=, field= const group = params.get("group") || ""; const field = params.get("field") || ""; const collection = params.get("target") || ""; - // Call our server proxy so it can use the server token + // Use server proxy so it can auth with server token const proxyUrl = `/api/directus/fields?collection=${encodeURIComponent(collection)}`; const metaRes = await fetch(proxyUrl, { cache: "no-store" }); if (!metaRes.ok) throw new Error(`Proxy ${metaRes.status} fetching ${proxyUrl}`); @@ -146,8 +147,14 @@ function useOptions(path: string) { setLoading(false); } return; // short-circuit + } else { + // unknown path → empty + setOpts([]); + setLoading(false); + return; } + } else { // unknown path → empty setOpts([]);