File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
apps/nextjs-website/src/app/[locale]/[productSlug]/tutorials/[...productTutorialPage] Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " nextjs-website " : patch
3+ ---
4+
5+ Add redirect to redirectPath if a user lands on a tutorial page with redirectPath set
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import {
1111 productToBreadcrumb ,
1212} from '@/helpers/structuredData.helpers' ;
1313
14+ import { redirect } from 'next/navigation' ;
15+
1416type Params = {
1517 locale : string ;
1618 productSlug : string ;
@@ -45,6 +47,13 @@ const Page = async (props: { params: Promise<Params> }) => {
4547
4648 const strapiTutorialProps = await getTutorial ( productSlug , [ tutorialPath ] ) ;
4749
50+ if (
51+ strapiTutorialProps . redirectPath &&
52+ strapiTutorialProps . redirectPath !== strapiTutorialProps . path
53+ ) {
54+ redirect ( strapiTutorialProps . redirectPath ) ;
55+ }
56+
4857 const structuredData = generateStructuredDataScripts ( {
4958 breadcrumbsItems : [
5059 productToBreadcrumb ( params . locale , strapiTutorialProps . product ) ,
You can’t perform that action at this time.
0 commit comments