react-next-boilerplate
react-next-boilerplate copied to clipboard
[...slug].js dev mode will not show draft entries
`export async function getStaticPaths() {
const storyblokApi = getStoryblokApi();
let { data } = await storyblokApi.get("cdn/links/");
let paths = [];
Object.keys(data.links).forEach((linkKey) => {
if (data.links[linkKey].is_folder || data.links[linkKey].slug === "home") {
return;
}
const slug = data.links[linkKey].slug;
let splittedSlug = slug.split("/");
paths.push({ params: { slug: splittedSlug } });
});
return {
paths: paths,
fallback: false,
};
}`
No sbParams included in the links call on your template, confused me when trying to view draft stories in dev mode. I kept getting errors that the story did not exist, only once published it worked.