Starting post load

This commit is contained in:
2024-05-09 16:06:43 +03:00
parent ec5769f70e
commit e2d2599a95
18 changed files with 274 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
<slot />
+15
View File
@@ -0,0 +1,15 @@
import { getPosts } from '$lib/db/post';
import { env } from '$lib/env';
/** @type {import('./$types').PageServerLoad} */
export async function load({ locals }) {
let result = await getPosts(locals.sql);
// console.log();
console.log(result);
return {
posts: result
};
}
+11
View File
@@ -0,0 +1,11 @@
<script>
import Postlist from "$comp/postlist.svelte";
/**
* @type {{posts: import("$types/base").Post[]}}
*/
export let data;
</script>
<h1>Posts</h1>
<Postlist posts={data.posts}></Postlist>
+8
View File
@@ -0,0 +1,8 @@
/** @type {import('./$types').PageServerLoad} */
export function load({ cookies }) {
// coo
return {
};
}
View File