From 2bce1824a96ac9b7af952653cd6da0f7890b3fa1 Mon Sep 17 00:00:00 2001 From: kailasnadh790 <53608019+kailasnadh790@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:11:41 -0500 Subject: [PATCH] Update contest-form.js review comments --- cigaradvisor/blocks/contest-form/contest-form.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cigaradvisor/blocks/contest-form/contest-form.js b/cigaradvisor/blocks/contest-form/contest-form.js index f7ee39a6..e2afdf56 100644 --- a/cigaradvisor/blocks/contest-form/contest-form.js +++ b/cigaradvisor/blocks/contest-form/contest-form.js @@ -1,13 +1,16 @@ +import { readBlockConfig } from '../../scripts/aem.js'; + export default async function decorate(block) { + const config = readBlockConfig(block); const iframeWrapper = document.createElement('div'); - iframeWrapper.id = 'vsscript_148868_314195'; + iframeWrapper.id = config.formid; block.replaceChildren(iframeWrapper); const p = document.createElement('p'); function loadScript() { const script = document.createElement('script'); script.async = true; script.type = 'text/javascript'; - script.src = 'https://app.viralsweep.com/vsa-widget-bedfd7-148868.js?sid=148868_314195'; + script.src = config.formurl; p.appendChild(script); } block.appendChild(p);