From f37a84d4f37855cee517643a799cbfc3c163bd18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Mon, 19 Sep 2022 14:55:10 +0200 Subject: [PATCH] Only count published photos on Grid count --- src/routes/photos/+page.server.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/routes/photos/+page.server.ts b/src/routes/photos/+page.server.ts index 1354477..19fe2b5 100644 --- a/src/routes/photos/+page.server.ts +++ b/src/routes/photos/+page.server.ts @@ -52,7 +52,16 @@ export const load: PageServerLoad = async ({ url }) => { } # Total - total_published: photo_aggregated ${queryCountry !== 'all' ? `(filter: { location: { country: { slug: { _eq: "${queryCountry}" }}}})` : ''} { + total_published: photo_aggregated ${queryCountry !== 'all' ? `( + filter: { + location: { country: { slug: { _eq: "${queryCountry}" }}}, + status: { _eq: "published" }, + } + )` : `( + filter: { + status: { _eq: "published" }, + } + )`} { count { id } } }`)