[chore] Switch Homepage and Photos to page endpoints
This commit is contained in:
@@ -144,40 +144,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</PageTransition>
|
||||
|
||||
|
||||
<script context="module" lang="ts">
|
||||
import { fetchAPI } from '$utils/api'
|
||||
|
||||
/** @type {import('@sveltejs/kit').Load} */
|
||||
export async function load ({ url, params, fetch, session, stuff }) {
|
||||
const res = await fetchAPI(`
|
||||
query {
|
||||
photo (limit: 11, sort: ["-date_created"]) {
|
||||
slug
|
||||
title
|
||||
city
|
||||
location {
|
||||
name
|
||||
slug
|
||||
country {
|
||||
slug
|
||||
name
|
||||
flag { id }
|
||||
}
|
||||
}
|
||||
image { id }
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
const { data } = res
|
||||
|
||||
return {
|
||||
props: {
|
||||
photos: data.photo,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</PageTransition>
|
||||
Reference in New Issue
Block a user