Skip to content

Commit

Permalink
error page and fetch posts to page.server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
allurei committed Dec 19, 2024
1 parent e040fff commit 2856925
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/routes/+error.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script>
import { page } from '$app/stores';
console.log($page)
</script>

<div class="wrap">
<p>{$page.status}-{$page.error.message}</p>
<a href=".">Etusivulle</a>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const load = async ({fetch, params }) => {

if (response.ok) {
const data = await response.json();

return {
posts: data
};
Expand Down

0 comments on commit 2856925

Please sign in to comment.