Get counts from API
This commit is contained in:
@@ -6,11 +6,13 @@
|
||||
import Footer from '$components/organisms/Footer.svelte'
|
||||
|
||||
export let data: any
|
||||
export let count: any
|
||||
|
||||
// Set global data
|
||||
setContext('global', data)
|
||||
|
||||
// console.log(data)
|
||||
setContext('global', {
|
||||
...data,
|
||||
count,
|
||||
})
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
@@ -56,6 +58,17 @@
|
||||
instagram
|
||||
footer_links
|
||||
}
|
||||
|
||||
# Count
|
||||
photo_aggregated {
|
||||
count { id }
|
||||
}
|
||||
location_aggregated {
|
||||
count { id }
|
||||
}
|
||||
country_aggregated {
|
||||
count { id }
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
@@ -64,6 +77,11 @@
|
||||
return {
|
||||
props: {
|
||||
data,
|
||||
count: {
|
||||
photos: data.photo_aggregated[0].count.id,
|
||||
locations: data.location_aggregated[0].count.id,
|
||||
countries: data.country_aggregated[0].count.id,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user