From 037fedaadc00cadfa7195480f83a449c58c7cab4 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Wed, 7 Aug 2024 17:25:34 -0400 Subject: [PATCH] Removing unnecessary await stuff --- src/helpers/cms-content-helper.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/helpers/cms-content-helper.js b/src/helpers/cms-content-helper.js index 455aee81..c5b462eb 100644 --- a/src/helpers/cms-content-helper.js +++ b/src/helpers/cms-content-helper.js @@ -97,7 +97,7 @@ function findAndReplaceGlobalStateValues(widgetModel, widgetName) { * @param baseResponse * @param clientResponse */ -async function processPageData(baseResponse, clientResponse) { +function processPageData(baseResponse, clientResponse) { const pageDataFromCms = {}; let widgets = []; @@ -165,20 +165,20 @@ async function processPageData(baseResponse, clientResponse) { * * @param issPage */ -export async function fetchCmsContentForPage(issPage) { +export function fetchCmsContentForPage(issPage) { const store = useMainStore(); const { clientName } = store.issConfig; const { parentAccountNumber } = store.issConfig; const clientOverride = clientName.length > 0 && parentAccountNumber > 0; - return await ( + return ( store .getPageData(issPage) // Get the base/default page first. - .then(async (baseResponse) => { + .then((baseResponse) => { if (!clientOverride) { // Return the base page if there are no client override. - return await processPageData(baseResponse, null); + return processPageData(baseResponse, null); } // Else get the client override page. const pageName = `${issPage}_${clientName.toLowerCase().replace(/ /g, '')}`; @@ -187,11 +187,10 @@ export async function fetchCmsContentForPage(issPage) { (clientResponse) => // Process the client override if it exists. processPageData(baseResponse, clientResponse), - async (error) => { + (error) => { console.error(error); // Process the just the base if no client override exists. - var x = await processPageData(baseResponse, null); - return x; + return processPageData(baseResponse, null); } ); })