Skip to content

Commit f41686b

Browse files
committed
Fix build
1 parent 4da9e0f commit f41686b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

web/pages/api/newsletter-rss/groq.global.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { functions } from '../../../lib/queries/common/functions'
22
import { ingressForNewsQuery } from '../../../lib/queries/common/newsSubqueries'
33
import { publishDateTimeQuery } from '../../../lib/queries/common/publishDateTime'
4-
import { sameLang } from '../../../lib/queries/common/langAndDrafts'
4+
import { sameLang, noDrafts } from '../../../lib/queries/common/langAndDrafts'
55
import type { ImageWithCaptionData } from '../../../types'
66
import type { PortableTextBlock } from '@portabletext/types'
77

@@ -21,7 +21,7 @@ export type LatestNewsType = {
2121

2222
export const latestNews = /* groq */ `
2323
${functions}
24-
*[_type == "news" && ((defined(subscriptionType) && ${sameLang}) || subscriptionType == "Crude")] | order(${publishDateTimeQuery} desc)[0...5] {
24+
*[_type == "news" && ((defined(subscriptionType) && ${sameLang}) || subscriptionType == "Crude") && ${noDrafts}] | order(${publishDateTimeQuery} desc)[0...5] {
2525
_id,
2626
"type":_type,
2727
"slug": slug.current,
@@ -35,7 +35,7 @@ ${functions}
3535
`
3636
export const latestMagazine = /* groq */ `
3737
${functions}
38-
*[_type == "magazine" && shouldDistributeMagazine && ${sameLang}] | order(${publishDateTimeQuery} desc)[0...5] {
38+
*[_type == "magazine" && shouldDistributeMagazine && ${sameLang} && ${noDrafts}] | order(${publishDateTimeQuery} desc)[0...5] {
3939
_id,
4040
"type":_type,
4141
"slug": slug.current,

web/pages/api/newsletter-rss/index.global.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const generateRssFeed = async (locale: 'en_GB' | 'nb_NO') => {
1313
try {
1414
// Fetch both English and Norwegian articles from news and magazine
1515
const [newsArticles, magazineArticles] = await Promise.all([
16-
sanityClient.fetch(latestNews, { lang: locale }, { perspective: 'published' }),
17-
sanityClient.fetch(latestMagazine, { lang: locale }, { perspective: 'published' }),
16+
sanityClient.fetch(latestNews, { lang: locale }),
17+
sanityClient.fetch(latestMagazine, { lang: locale }),
1818
])
1919

2020
// Merge the articles and sort by publish date (newest first)

0 commit comments

Comments
 (0)