Starting post load
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<slot />
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
@@ -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>
|
||||
@@ -0,0 +1,8 @@
|
||||
/** @type {import('./$types').PageServerLoad} */
|
||||
export function load({ cookies }) {
|
||||
// coo
|
||||
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user