diff --git a/apps/charterafrica/src/components/FeaturedVideos/FeaturedVideos.js b/apps/charterafrica/src/components/FeaturedVideos/FeaturedVideos.js index 21a7a5314..5a792919c 100644 --- a/apps/charterafrica/src/components/FeaturedVideos/FeaturedVideos.js +++ b/apps/charterafrica/src/components/FeaturedVideos/FeaturedVideos.js @@ -19,7 +19,7 @@ const FeaturedVideos = forwardRef(function FeaturedVideos(props, ref) { {title} - {items.map((item) => ( + {items?.map((item) => ( diff --git a/apps/charterafrica/src/lib/data/common/processPageOpportunities.js b/apps/charterafrica/src/lib/data/common/processPageOpportunities.js index 769a19e8c..13b3e6116 100644 --- a/apps/charterafrica/src/lib/data/common/processPageOpportunities.js +++ b/apps/charterafrica/src/lib/data/common/processPageOpportunities.js @@ -1,5 +1,7 @@ import { deepmerge } from "@mui/utils"; +import processFeaturedVideos from "./processBlockFeaturedVideos"; + import formatDateTime from "@/charterafrica/utils/formatDate"; function processOpportunity(opportunity, pageUrl, api, context) { @@ -171,7 +173,8 @@ const fetchOpportunitiesCollectionFunctionMap = { grants: fetchGrants, }; -async function processPageOpportunities(page, api, context) { +async function processPageOpportunities(unProcessedPage, api, context) { + const page = await processFeaturedVideos(unProcessedPage, context.locale); const { blocks, breadcrumbs = [] } = page; const pageUrl = breadcrumbs[breadcrumbs.length - 1].url; const opportunitiesBlocks = await Promise.all(