Place: Fix fields
This commit is contained in:
@@ -6,12 +6,12 @@
|
|||||||
// Load photos
|
// Load photos
|
||||||
const fields = [
|
const fields = [
|
||||||
'id', 'name', 'slug', 'date', 'image.*',
|
'id', 'name', 'slug', 'date', 'image.*',
|
||||||
'location.id', 'location.name', 'location.region', 'location.country.name',
|
'location.id', 'location.name', 'location.slug', 'location.region', 'location.country.name', 'location.country.slug',
|
||||||
'created_on', 'modified_on'
|
'created_on'
|
||||||
]
|
].join(',')
|
||||||
const sort = ['-created_on', 'name']
|
const sort = ['-created_on', 'name'].join(',')
|
||||||
const limit = -1
|
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()
|
const photos = await req.json()
|
||||||
if (req.ok) {
|
if (req.ok) {
|
||||||
return { photos: photos.data }
|
return { photos: photos.data }
|
||||||
|
|||||||
Reference in New Issue
Block a user