Skip to content

Commit

Permalink
Fixup! Monkey patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama committed Oct 4, 2023
1 parent 903a362 commit c8510dd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/(storyblok)/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import {
import { resolveRelations } from '@/utilities/resolveRelations';
import { getPageMetadata } from '@/utilities/getPageMetadata';
import { notFound } from 'next/navigation';

const activeEnv = process.env.NODE_ENV || 'development';

type PathsType = {
slug: string[];
};
Expand All @@ -19,7 +16,8 @@ type Props = {

// Make sure to not export the below functions otherwise there will be a typescript error
// https://github.com/vercel/next.js/discussions/48724
async function getStoryData(params: { slug: string[] }) {
export async function getStoryData(params: { slug: string[] }) {
const activeEnv = process.env.NODE_ENV || 'development';
let slug: string = params.slug ? params.slug.join('/') : '';
let sbParams: ISbStoriesParams = {
version: activeEnv === 'development' ? 'draft' : 'published',
Expand Down Expand Up @@ -61,6 +59,7 @@ export async function generateMetadata({ params }: Props, parent: ResolvingMetad
* Generate static paths for the inside pages.
*/
export async function generateStaticParams(): Promise<any[]> {
const activeEnv = process.env.NODE_ENV || 'development';
const storyblokApi: StoryblokClient = getStoryblokApi();
let sbParams: ISbStoriesParams = {
version: activeEnv === 'development' ? 'draft' : 'published',
Expand Down

0 comments on commit c8510dd

Please sign in to comment.