From fd0e1b75aa4a0e74dccf5fcb8d4c41b855e8530f Mon Sep 17 00:00:00 2001 From: Sherakama Date: Thu, 10 Oct 2024 13:30:10 -0700 Subject: [PATCH] HOTFIX: API Throttling. (#355) * HOTFIX: API Throttling. --- app/(storyblok)/[[...slug]]/not-found.tsx | 1 - app/(storyblok)/[[...slug]]/page.tsx | 1 - app/not-found.tsx | 1 - app/sitemap.ts | 1 - utilities/data/getStoryData.ts | 2 +- utilities/data/getStoryList.ts | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/(storyblok)/[[...slug]]/not-found.tsx b/app/(storyblok)/[[...slug]]/not-found.tsx index fdd82df5..cf98922b 100644 --- a/app/(storyblok)/[[...slug]]/not-found.tsx +++ b/app/(storyblok)/[[...slug]]/not-found.tsx @@ -41,7 +41,6 @@ async function getStoryData(slug = 'momentum/page-not-found') { const storyblokApi: StoryblokClient = getStoryblokApi(); const sbParams: ISbStoriesParams = { version: isProd ? 'published' : 'draft', - cv: Date.now(), resolve_relations: resolveRelations, }; diff --git a/app/(storyblok)/[[...slug]]/page.tsx b/app/(storyblok)/[[...slug]]/page.tsx index 53f7efaf..73ab7dff 100644 --- a/app/(storyblok)/[[...slug]]/page.tsx +++ b/app/(storyblok)/[[...slug]]/page.tsx @@ -61,7 +61,6 @@ export async function generateStaticParams() { const storyblokApi: StoryblokClient = getStoryblokApi(); let sbParams: ISbStoriesParams = { version: isProd ? 'published' : 'draft', - cv: Date.now(), resolve_links: '0', resolve_assets: 0, per_page: 100, diff --git a/app/not-found.tsx b/app/not-found.tsx index fdd82df5..cf98922b 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -41,7 +41,6 @@ async function getStoryData(slug = 'momentum/page-not-found') { const storyblokApi: StoryblokClient = getStoryblokApi(); const sbParams: ISbStoriesParams = { version: isProd ? 'published' : 'draft', - cv: Date.now(), resolve_relations: resolveRelations, }; diff --git a/app/sitemap.ts b/app/sitemap.ts index ef935f51..6b3c6c42 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -20,7 +20,6 @@ export default async function sitemap(): Promise { // Fetch new content from storyblok. let sbParams: ISbStoriesParams = { version: isProd ? 'published' : 'draft', - cv: Date.now(), resolve_links: '0', resolve_assets: 0, per_page: 100, diff --git a/utilities/data/getStoryData.ts b/utilities/data/getStoryData.ts index 4ca6f0d8..144588be 100644 --- a/utilities/data/getStoryData.ts +++ b/utilities/data/getStoryData.ts @@ -13,7 +13,7 @@ async function getStoryData({ path, isEditor = false }: getStoryDataProps): Prom let sbParams: ISbStoriesParams = { version: isProd && !isEditor ? 'published' : 'draft', - cv: Date.now(), + cv: isEditor ? Date.now() : undefined, resolve_relations: resolveRelations, }; diff --git a/utilities/data/getStoryList.ts b/utilities/data/getStoryList.ts index 6af90f39..c24c3f02 100644 --- a/utilities/data/getStoryList.ts +++ b/utilities/data/getStoryList.ts @@ -40,7 +40,6 @@ async function getStoryList({ path }: getStoryDataProps) { // For more related documentation see app/(storyblok)/[[...slug]]/page.tsx const sbParams: ISbStoriesParams = { version: isProd ? 'published' : 'draft', - cv: Date.now(), starts_with: `${getSlugPrefix()}/stories/`, sort_by: 'first_published_at:desc', per_page: 100,