Skip to content

Commit

Permalink
submit link is required
Browse files Browse the repository at this point in the history
  • Loading branch information
shsteimer committed Jun 24, 2024
1 parent 9e55017 commit 7718ad1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blocks/form/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default async function decorate(block) {
const links = [...block.querySelectorAll('a')].map((a) => a.href);
const formLink = links.find((link) => link.startsWith(window.location.origin) && link.endsWith('.json'));
const submitLink = links.find((link) => link !== formLink);
if (!formLink) return;
if (!formLink || !submitLink) return;

const form = await createForm(formLink, submitLink);
block.replaceChildren(form);
Expand Down

0 comments on commit 7718ad1

Please sign in to comment.