Skip to content

Commit

Permalink
Merge pull request #554 from UKHSA-Internal/fix/landing-page-slug
Browse files Browse the repository at this point in the history
Fix: Dynamic landing page call
  • Loading branch information
rhys-burendo authored Nov 28, 2024
2 parents 1f909e7 + cf48054 commit ab91d95
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/(cms)/[[...slug]]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import Link from 'next/link'
import { ReactNode } from 'react'
import { Trans } from 'react-i18next/TransWithoutContext'

import { PageType } from '@/api/requests/cms/getPages'
import { getPageBySlug } from '@/api/requests/getPageBySlug'
import { Announcement, BackToTop } from '@/app/components/ui/ukhsa'
import HeroBanner from '@/app/components/ui/ukhsa/HeroBanner/HeroBanner'
import { MegaMenu } from '@/app/components/ui/ukhsa/MegaMenu/MegaMenu'
Expand All @@ -13,6 +11,7 @@ import { TopNav } from '@/app/components/ui/ukhsa/TopNav/TopNav'
import { flags } from '@/app/constants/flags.constants'
import { getGlobalBanner } from '@/app/hooks/getGlobalBanner'
import { getServerTranslation } from '@/app/i18n'
import { getLandingPage } from '@/app/utils/cms'
import { getFeatureFlag } from '@/app/utils/flags.utils'

interface LayoutProps {
Expand All @@ -27,7 +26,7 @@ export default async function Layout({ children, params }: LayoutProps) {
getGlobalBanner(),
])

const { sub_title: subTitle } = await getPageBySlug<PageType.Landing>('landing-page')
const { sub_title: subTitle } = await getLandingPage()

const onHomePage = landingPageHeroEnabled && !params?.slug

Expand Down

1 comment on commit ab91d95

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests coverage

Lines Statements Branches Functions
Coverage: 93%
91.97% (1766/1920) 82.02% (406/495) 89.31% (259/290)
Tests Skipped Failures Errors Time
470 0 💤 0 ❌ 0 🔥 15.359s ⏱️

Please sign in to comment.