Skip to content

Commit 97b3639

Browse files
committed
1 parent ad7db77 commit 97b3639

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

web/app/[locale]/(pages)/news/archive/[...slug]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default async function LocaleLayout({
3131
const slugs =
3232
archivedItems?.map((data: PathType) => ({
3333
slug: `${data.locale === 'no' ? '/no' : ''}${data.slug as string}`,
34-
lang: data.locale === 'en' ? 'en_GB' : 'nb_NO',
34+
lang: data.locale === 'en' ? 'en-GB' : 'nb-NO',
3535
})) ?? []
3636

3737
return (

web/app/[locale]/(pages)/news/archive/[...slug]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import { Flags } from '@/sanity/helpers/datasetHelpers'
77
import type { PathType } from '@/sanity/queries/paths/getPaths'
88
import ArchivedNews from '@/templates/archivedNews/ArchivedNews'
99

10+
1011
type Params = Promise<{ locale: string; slug: string[] }>
1112
//TODO types
1213
async function getArchivedPageData(params: { locale: string; slug: string[] }) {
1314
const { locale: routeLocale, slug: pagePathArray } = params
14-
const locale = routeLocale === 'en-GB' ? 'en' : routeLocale
15+
const locale =(routeLocale === 'en-GB')? 'en' : 'no'
1516
if (!Flags.HAS_ARCHIVED_NEWS) return { notFound: true }
1617

1718
const pagePath = pagePathArray?.join('/')
@@ -35,7 +36,6 @@ export async function generateMetadata({
3536
params: Params
3637
}): Promise<Metadata> {
3738
const { locale, slug: pagePathArray } = await params
38-
3939
const archivedItems = archivedNews.filter(
4040
e => e.slug === `/news/archive/${pagePathArray.join('/')}`,
4141
)

0 commit comments

Comments
 (0)