fix: Include submitter data in partial form data (#2307)

Fixes #2306
This commit is contained in:
Adam Gregory
2024-06-06 19:02:49 +02:00
committed by GitHub
parent c3ec742a65
commit 8c5e2b00c9
2 changed files with 31 additions and 17 deletions
+2 -2
View File
@@ -251,10 +251,10 @@ document.addEventListener("submit", async (e) => {
if (lowerMethod === "get") {
// TODO: Looks like constructor type for URLSearchParam is wrong
// deno-lint-ignore no-explicit-any
const qs = new URLSearchParams(new FormData(el) as any);
const qs = new URLSearchParams(new FormData(el, e.submitter) as any);
qs.forEach((value, key) => partialUrl.searchParams.set(key, value));
} else {
init = { body: new FormData(el), method: lowerMethod };
init = { body: new FormData(el, e.submitter), method: lowerMethod };
}
await fetchPartials(actionUrl, partialUrl, init);