From e830a1845402b29a3b777d43c36a04796c216df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Sun, 24 Oct 2021 22:20:01 +0200 Subject: [PATCH] Use total photos count from global data --- src/routes/[country]/[location]/index.svelte | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/routes/[country]/[location]/index.svelte b/src/routes/[country]/[location]/index.svelte index 247e141..b70a29c 100644 --- a/src/routes/[country]/[location]/index.svelte +++ b/src/routes/[country]/[location]/index.svelte @@ -279,14 +279,13 @@ `) const { data } = res - const locationId = data.location[0].id - const locationPhotosCount = data.total_published.find(({ group }: any) => group.location === Number(locationId)) + const photosCount = stuff.countTotalPhotosByLocation.find((total: any) => total.group.location === Number(data.location[0].id)) return { props: { location: data.location[0], photos: data.photos, - totalPhotos: data.photos.length ? locationPhotosCount.count.id : 0, + totalPhotos: data.photos.length ? photosCount.count.id : 0, lastUpdated: data.photos.length ? data.photos[0].date_created : undefined, } }