Add: Post Metrics

This commit is contained in:
2024-05-14 14:01:21 +03:00
parent eb7271a0c3
commit 5eb5f2d5ff
3 changed files with 62 additions and 0 deletions
@@ -1,5 +1,6 @@
import { getCommentsForPost } from "$lib/server/db/comment";
import { getPost } from "$lib/server/db/post";
import { getPostMetrics } from "$lib/server/db/postmertics";
import { getIdFromName } from "$lib/util";
import { error } from "@sveltejs/kit";
@@ -15,6 +16,8 @@ export async function load({ params, locals }) {
const comments = await getCommentsForPost(locals.sql, post_id);
console.log(await getPostMetrics(post));
return {
post: post,
comments: comments