published-filter-fix
This commit is contained in:
parent
76a15c8aa9
commit
7bc743d8a7
|
@ -55,7 +55,7 @@ export const HomeView = (props: Props) => {
|
||||||
loadTopMonthArticles()
|
loadTopMonthArticles()
|
||||||
if (sortedArticles().length < PRERENDERED_ARTICLES_COUNT + CLIENT_LOAD_ARTICLES_COUNT) {
|
if (sortedArticles().length < PRERENDERED_ARTICLES_COUNT + CLIENT_LOAD_ARTICLES_COUNT) {
|
||||||
const { hasMore } = await loadShouts({
|
const { hasMore } = await loadShouts({
|
||||||
filters: { visibility: 'public' },
|
filters: { published: true },
|
||||||
limit: CLIENT_LOAD_ARTICLES_COUNT,
|
limit: CLIENT_LOAD_ARTICLES_COUNT,
|
||||||
offset: sortedArticles().length,
|
offset: sortedArticles().length,
|
||||||
})
|
})
|
||||||
|
@ -84,7 +84,7 @@ export const HomeView = (props: Props) => {
|
||||||
saveScrollPosition()
|
saveScrollPosition()
|
||||||
|
|
||||||
const { hasMore } = await loadShouts({
|
const { hasMore } = await loadShouts({
|
||||||
filters: { visibility: 'public' },
|
filters: { published: true },
|
||||||
limit: LOAD_MORE_PAGE_SIZE,
|
limit: LOAD_MORE_PAGE_SIZE,
|
||||||
offset: sortedArticles().length,
|
offset: sortedArticles().length,
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { apiClient } from '../graphql/client/core'
|
||||||
|
|
||||||
export const onBeforeRender = async (_pageContext: PageContext) => {
|
export const onBeforeRender = async (_pageContext: PageContext) => {
|
||||||
const options = {
|
const options = {
|
||||||
filters: { visibility: 'public' },
|
filters: { published: true },
|
||||||
limit: PRERENDERED_ARTICLES_COUNT,
|
limit: PRERENDERED_ARTICLES_COUNT,
|
||||||
}
|
}
|
||||||
const homeShouts = await apiClient.getShouts({ options })
|
const homeShouts = await apiClient.getShouts({ options })
|
||||||
|
|
|
@ -20,7 +20,7 @@ export const HomePage = (props: PageProps) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
loadShouts({ filters: { visibility: 'public' }, limit: PRERENDERED_ARTICLES_COUNT }),
|
loadShouts({ filters: { published: true }, limit: PRERENDERED_ARTICLES_COUNT }),
|
||||||
loadRandomTopics({ amount: RANDOM_TOPICS_COUNT }),
|
loadRandomTopics({ amount: RANDOM_TOPICS_COUNT }),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ export const loadTopMonthArticles = async (): Promise<void> => {
|
||||||
const after = Math.floor(daysago / 1000)
|
const after = Math.floor(daysago / 1000)
|
||||||
const options: LoadShoutsOptions = {
|
const options: LoadShoutsOptions = {
|
||||||
filters: {
|
filters: {
|
||||||
visibility: 'public',
|
published: true,
|
||||||
after,
|
after,
|
||||||
},
|
},
|
||||||
order_by: 'rating_stat',
|
order_by: 'rating_stat',
|
||||||
|
@ -206,9 +206,7 @@ const TOP_ARTICLES_COUNT = 10
|
||||||
|
|
||||||
export const loadTopArticles = async (): Promise<void> => {
|
export const loadTopArticles = async (): Promise<void> => {
|
||||||
const options: LoadShoutsOptions = {
|
const options: LoadShoutsOptions = {
|
||||||
filters: {
|
filters: { published: true },
|
||||||
visibility: 'public',
|
|
||||||
},
|
|
||||||
order_by: 'rating_stat',
|
order_by: 'rating_stat',
|
||||||
limit: TOP_ARTICLES_COUNT,
|
limit: TOP_ARTICLES_COUNT,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user