Get counts from API
This commit is contained in:
@@ -6,11 +6,13 @@
|
|||||||
import Footer from '$components/organisms/Footer.svelte'
|
import Footer from '$components/organisms/Footer.svelte'
|
||||||
|
|
||||||
export let data: any
|
export let data: any
|
||||||
|
export let count: any
|
||||||
|
|
||||||
// Set global data
|
// Set global data
|
||||||
setContext('global', data)
|
setContext('global', {
|
||||||
|
...data,
|
||||||
// console.log(data)
|
count,
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<slot />
|
<slot />
|
||||||
@@ -56,6 +58,17 @@
|
|||||||
instagram
|
instagram
|
||||||
footer_links
|
footer_links
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Count
|
||||||
|
photo_aggregated {
|
||||||
|
count { id }
|
||||||
|
}
|
||||||
|
location_aggregated {
|
||||||
|
count { id }
|
||||||
|
}
|
||||||
|
country_aggregated {
|
||||||
|
count { id }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
@@ -64,6 +77,11 @@
|
|||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
data,
|
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