From 39d12b7b34285d36b934d765c7de446baa58bf10 Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Thu, 29 Feb 2024 20:01:34 +0530 Subject: [PATCH] Run homepages magically --- .../NewfoldInterfaceSkeleton/SiteGen/index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js index 78f8366c0..5ea9b2e5f 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js @@ -14,6 +14,7 @@ import classNames from 'classnames'; import { setFlow } from '../../../utils/api/flow'; import { generateSiteGenMeta, + getHomepages, getSiteGenIdentifiers, } from '../../../utils/api/siteGen'; import Footer from '../../Footer'; @@ -130,6 +131,20 @@ const SiteGen = () => { ) { // Once all requests are completed use cache to get data currentData.sitegen.skipCache = false; + + // Increase count after site meta calls to ensure systematic call of homepages + currentData.sitegen.siteGenMetaStatus.totalCount += 1; + setCurrentOnboardingData( currentData ); + + // Get the homepages and set that in flow + const response = await getHomepages( + currentData.sitegen.siteDetails.prompt + ); + + if ( response.body ) { + currentData.sitegen.homepages.data = response.body; + } + currentData.sitegen.siteGenMetaStatus.currentStatus += 1; } // Sync the current request changed to State setCurrentOnboardingData( currentData );