diff --git a/src/services/cms/fetchArticlePageContent.ts b/src/services/cms/fetchArticlePageContent.ts index 4b27f0219..685b13031 100644 --- a/src/services/cms/fetchArticlePageContent.ts +++ b/src/services/cms/fetchArticlePageContent.ts @@ -32,7 +32,7 @@ export async function fetchArticlePageContent({ 'populate[3]': 'author.image', 'filters[slug][$eq]': articleSlug, sort: 'publishedAt:desc', - ...(isProduction ? {} : { status: 'draft' }), + ...(isProduction ? { status: 'published' } : { status: 'draft' }), }) const articleResponse = await cmsClient<{ @@ -60,6 +60,7 @@ export async function fetchArticlePageContent({ sort: 'createdAt:desc', 'pagination[start]': '0', 'pagination[limit]': '3', + ...(isProduction ? { status: 'published' } : { status: 'draft' }), }) const otherArticlesResponse = await cmsClient<{ diff --git a/src/services/cms/fetchArticlePageMetadata.ts b/src/services/cms/fetchArticlePageMetadata.ts index 3e2debfce..3cc9ae72d 100644 --- a/src/services/cms/fetchArticlePageMetadata.ts +++ b/src/services/cms/fetchArticlePageMetadata.ts @@ -23,7 +23,7 @@ export async function fetchArticlePageMetadata({ 'populate[0]': 'image', 'populate[1]': 'pageMetadata', 'filters[slug][$eq]': articleSlug, - ...(isProduction ? {} : { status: 'draft' }), + ...(isProduction ? { status: 'published' } : { status: 'draft' }), }) const articleResponse = await cmsClient<{ data: [PopulatedArticleType<'image' | 'pageMetadata'>] diff --git a/src/services/cms/fetchCategories.ts b/src/services/cms/fetchCategories.ts index 06ce9ce72..809822ea6 100644 --- a/src/services/cms/fetchCategories.ts +++ b/src/services/cms/fetchCategories.ts @@ -10,7 +10,7 @@ export async function fetchCategories(): Promise { const categoriesSearchParams = new URLSearchParams({ locale: defaultLocale, sort: 'order', - ...(isProduction ? {} : { status: 'draft' }), + ...(isProduction ? { status: 'published' } : { status: 'draft' }), }) const categoriesResponse = await cmsClient<{ data: CategoryType[] }>( diff --git a/src/services/cms/fetchCategoryPageContent.ts b/src/services/cms/fetchCategoryPageContent.ts index 76869af23..7fd141a7b 100644 --- a/src/services/cms/fetchCategoryPageContent.ts +++ b/src/services/cms/fetchCategoryPageContent.ts @@ -36,7 +36,7 @@ export async function fetchCategoryPageContent({ 'populate[2]': 'mainArticle', 'populate[3]': 'mainArticle.image', sort: 'questions.order:asc', - ...(isProduction ? {} : { status: 'draft' }), + ...(isProduction ? { status: 'published' } : { status: 'draft' }), }) const categoryResponse = await cmsClient<{ @@ -71,7 +71,7 @@ export async function fetchCategoryPageContent({ 'pagination[page]': page.toString(), 'pagination[pageSize]': PAGE_SIZE.toString(), sort: 'createdAt:desc', - ...(isProduction ? {} : { status: 'draft' }), + ...(isProduction ? { status: 'published' } : { status: 'draft' }), }) const articlesResponse = await cmsClient<{ diff --git a/src/services/cms/fetchCategoryPageMetadata.ts b/src/services/cms/fetchCategoryPageMetadata.ts index 64962a369..86065c611 100644 --- a/src/services/cms/fetchCategoryPageMetadata.ts +++ b/src/services/cms/fetchCategoryPageMetadata.ts @@ -23,7 +23,7 @@ export async function fetchCategoryPageMetadata({ 'populate[0]': 'image', 'populate[1]': 'pageMetadata', 'filters[slug][$eq]': slug, - ...(isProduction ? {} : { status: 'draft' }), + ...(isProduction ? { status: 'published' } : { status: 'draft' }), }) const categoryResponse = await cmsClient<{ diff --git a/src/services/cms/fetchHomepageContent.ts b/src/services/cms/fetchHomepageContent.ts index 70c28fffe..c2413179c 100644 --- a/src/services/cms/fetchHomepageContent.ts +++ b/src/services/cms/fetchHomepageContent.ts @@ -53,7 +53,7 @@ export async function fetchHomepageContent({ page }: { page: number }): Promise< 'pagination[page]': page.toString(), 'pagination[pageSize]': PAGE_SIZE.toString(), sort: 'createdAt:desc', - ...(isProduction ? {} : { status: 'draft' }), + ...(isProduction ? { status: 'published' } : { status: 'draft' }), } if (mainArticle) {