From d9c529eae0e9f36f01d168495a596ae0c4a051e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Sun, 22 Mar 2020 17:31:53 +0100 Subject: [PATCH] Place: Fix fields --- src/routes/location/[country]/[place].svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/location/[country]/[place].svelte b/src/routes/location/[country]/[place].svelte index 97114ca..e65f2cf 100644 --- a/src/routes/location/[country]/[place].svelte +++ b/src/routes/location/[country]/[place].svelte @@ -6,12 +6,12 @@ // Load photos const fields = [ 'id', 'name', 'slug', 'date', 'image.*', - 'location.id', 'location.name', 'location.region', 'location.country.name', - 'created_on', 'modified_on' - ] - const sort = ['-created_on', 'name'] + 'location.id', 'location.name', 'location.slug', 'location.region', 'location.country.name', 'location.country.slug', + 'created_on' + ].join(',') + const sort = ['-created_on', 'name'].join(',') const limit = -1 - const req = await this.fetch(`${apiEndpoints.rest}/items/photos?fields=${fields.join()}&filter[location.slug][rlike]=%${page.params.place}%&limit=${limit}&sort=${sort.join()}`) + const req = await this.fetch(`${apiEndpoints.rest}/items/photos?fields=${fields}&filter[location.slug][rlike]=%${page.params.place}%&limit=${limit}&sort=${sort}`) const photos = await req.json() if (req.ok) { return { photos: photos.data }