Fix Location page total photos amount

This commit is contained in:
2021-10-17 13:41:38 +02:00
parent 62ddc32795
commit ea2162c2b9

View File

@@ -219,8 +219,7 @@
filter: { filter: {
slug: { _eq: "${location}" }, slug: { _eq: "${location}" },
status: { _eq: "published" }, status: { _eq: "published" },
}, }
limit: ${import.meta.env.VITE_LIST_AMOUNT},
) { ) {
id id
name name
@@ -264,7 +263,8 @@
`) `)
const { data } = res const { data } = res
const locationPhotosCount = data.total_published.find(({ group }: any) => group.id === data.location.id) const locationId = data.location[0].id
const locationPhotosCount = data.total_published.find(({ group }: any) => group.location === Number(locationId))
return { return {
props: { props: {