Only fetch published photos on location page

This commit is contained in:
2022-10-10 17:45:24 +02:00
parent 24b9550c24
commit a927b358d7

View File

@@ -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