submit 'type' fixes
This commit is contained in:
parent
aa8436da93
commit
abec600bb6
1 changed files with 8 additions and 1 deletions
|
|
@ -107,13 +107,14 @@ function useOptions(path: string) {
|
|||
});
|
||||
};
|
||||
}
|
||||
|
||||
} else if (rawPath === "repeater-choices") {
|
||||
// target=<collection>, group=<repeater field>, field=<child 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([]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue