From a927b358d799710d492fa6de468542f37a4eb959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Mon, 10 Oct 2022 17:45:24 +0200 Subject: [PATCH] Only fetch published photos on location page --- src/routes/[country]/[location]/+page.server.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/routes/[country]/[location]/+page.server.ts b/src/routes/[country]/[location]/+page.server.ts index 3a44eaa..29069ee 100644 --- a/src/routes/[country]/[location]/+page.server.ts +++ b/src/routes/[country]/[location]/+page.server.ts @@ -41,7 +41,8 @@ export const load: PageServerLoad = async ({ params, setHeaders }) => { photos: photo ( filter: { - location: { slug: { _eq: "${slug}" }} + location: { slug: { _eq: "${slug}" }}, + status: { _eq: "published" }, }, sort: "-date_created", limit: ${PUBLIC_LIST_AMOUNT}, @@ -56,7 +57,12 @@ export const load: PageServerLoad = async ({ params, setHeaders }) => { } # Shop product - product (filter: { location: { slug: { _eq: "${slug}" }}}) { + product ( + filter: { + location: { slug: { _eq: "${slug}" }}, + status: { _eq: "published" }, + } + ) { photos_product { directus_files_id { id