Filter continents with linked countries in server request
This commit is contained in:
@@ -92,9 +92,15 @@
|
||||
|
||||
const { data } = res
|
||||
|
||||
// Filter continents with linked countries
|
||||
const filteredContinents = data.continent.filter((cont: any) => cont.countries.length)
|
||||
|
||||
return {
|
||||
props: {
|
||||
data,
|
||||
data: {
|
||||
...data,
|
||||
continent: filteredContinents,
|
||||
},
|
||||
count: {
|
||||
photos: data.photo_aggregated[0].count.id,
|
||||
locations: data.location_aggregated[0].count.id,
|
||||
|
||||
Reference in New Issue
Block a user