diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 99cd80ef..865c41f1 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -39,19 +39,18 @@ export default async function decorate(block) { const programData = await programDataPromise; const program = programData.data.programList.items[0]; const header = buildHeader(program, queryVars).outerHTML; - + // Update the header with the actual data block.querySelector('.placeholder-header').outerHTML = header; let imageObject = null; + let totalassets = 0; if (program) { try { imageObject = await searchAsset(program.programName, program.campaignName); if (imageObject) { insertImageIntoCampaignImg(block, imageObject); - document.getElementById('totalassets').textContent = imageObject.assetCount; - } else { - document.getElementById('totalassets').textContent = 0; + totalassets = imageObject.assetCount; } } catch (error) { console.error("Failed to load campaign image:", error); @@ -145,7 +144,7 @@ export default async function decorate(block) { ${buildArtifactLinks(program).outerHTML}
Total Approved Assets
- + ${totalassets} To view the assets, go to the "All Asset" search page and use Program and Campaign name facet to filter the assets