diff --git a/src/app.html b/src/app.html
index 77a5ff5..4adb46e 100644
--- a/src/app.html
+++ b/src/app.html
@@ -5,6 +5,8 @@
%sveltekit.head%
+
+
%sveltekit.body%
diff --git a/src/routes/projects.svelte b/src/routes/projects.svelte
index d3cadbb..515ce2e 100644
--- a/src/routes/projects.svelte
+++ b/src/routes/projects.svelte
@@ -6,20 +6,37 @@
const preview_count = 7
onMount(async () => {
- const response = await fetch("/api/jam-games");
- let jamGames = (await response.json()).data;
+ let jamGames = []
+ try {
+ const response = await fetch(`/api/jam-games`, {
+ method: 'GET',
+ headers: {
+ 'Accept': 'application/json'
+ }
+ })
+ const responseText = await response.text()
+ if (responseText == "Not found")
+ {
+ return
+ }
+ jamGames = JSON.parse(responseText).data
+ }
+ catch (error)
+ {
+ console.log(error)
+ }
- jamGames.forEach((game) => {
- clubProjects.push({
- name: game.game.title,
- author: game.game.user.name,
- url: game.game.url,
- image: game.game.cover,
- });
- });
+ jamGames.forEach((game) => {
+ clubProjects.push({
+ name: game.game.title,
+ author: game.game.user.name,
+ url: game.game.url,
+ image: game.game.cover,
+ });
+ });
- clubProjects = clubProjects;
- clubProjects = clubProjects.slice(0,7)
+ clubProjects = clubProjects
+ clubProjects = clubProjects.slice(0,7)
});
diff --git a/src/routes/projects/+page.svelte b/src/routes/projects/+page.svelte
index 6f4fd36..6eef7a3 100644
--- a/src/routes/projects/+page.svelte
+++ b/src/routes/projects/+page.svelte
@@ -16,6 +16,10 @@
}
})
const responseText = await response.text()
+ if (responseText == "Not found")
+ {
+ return
+ }
jamGames = JSON.parse(responseText).data
}
catch (error)
diff --git a/src/routes/zine/+page.js b/src/routes/zine/+page.js
index 40cc128..f9592d0 100644
--- a/src/routes/zine/+page.js
+++ b/src/routes/zine/+page.js
@@ -9,6 +9,12 @@ export const load = async ({ fetch }) => {
}
})
const responseText = await response.text()
+ if (responseText == "Not found")
+ {
+ return {
+ posts
+ }
+ }
posts = JSON.parse(responseText)
}
catch (error)