Skip to content

Commit

Permalink
form action added for documentbasedform
Browse files Browse the repository at this point in the history
  • Loading branch information
gargadobe committed Feb 12, 2024
1 parent 21933c0 commit 638d44c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions blocks/form/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ function isDocumentBasedForm(formDef) {

export default async function decorate(block) {
let container = block.querySelector('a[href$=".json"]');
let formDef;
let formDef, pathname;

Check failure on line 364 in blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Split 'let' declarations into multiple statements

Check failure on line 364 in blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Expected variable declaration to be on a new line
if (container) {
const { pathname } = new URL(container.href);
({ pathname } = new URL(container.href));
formDef = await fetchForm(pathname);
} else {
container = block.querySelector('pre');
Expand All @@ -379,6 +379,7 @@ export default async function decorate(block) {
const transform = new DocBaseFormToAF();
const afFormDef = transform.transform(formDef);
const form = await createForm(afFormDef, data);
form.dataset.action = pathname?.split('.json')[0];;

Check failure on line 382 in blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Missing whitespace after semicolon

Check failure on line 382 in blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unnecessary semicolon
container.replaceWith(form);
} else {
afModule = await import('./rules/index.js');

Check failure on line 385 in blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unable to resolve path to module './rules/index.js'
Expand Down

0 comments on commit 638d44c

Please sign in to comment.