From accd3be56d9ad4303e76425ac88b0cd845ff9ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Tue, 2 Jul 2024 11:04:24 +0200 Subject: [PATCH] Ensure displaying only published content --- app/page.js | 10 ++++++++++ components/konstitisyon/list-comments.js | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/page.js b/app/page.js index ae00d64..d0d50b3 100644 --- a/app/page.js +++ b/app/page.js @@ -21,12 +21,22 @@ async function getData() { try { const titres = await client.request( readItems('titres', { + filter: { + status: { + _eq: 'published' + } + }, sort: 'numero' }) ) const articles = await client.request( readItems('articles', { + filter: { + status: { + _eq: 'published' + } + }, sort: 'numero' }) ) diff --git a/components/konstitisyon/list-comments.js b/components/konstitisyon/list-comments.js index 6d6ee2f..e0f2e00 100644 --- a/components/konstitisyon/list-comments.js +++ b/components/konstitisyon/list-comments.js @@ -34,7 +34,10 @@ export default function ListComments({session, selectedTitre, isOpen, setIsOpen, session.user.accessToken, readItems('commentaires', { filter: { - titre: selectedTitre.id + titre: selectedTitre.id, + status: { + _eq: 'published' + } }, sort: '-date_created' }))