Законченный MVP
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { getPostBySlug } from '$lib/blog/posts';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = ({ params }) => {
|
||||
const post = getPostBySlug(params.slug);
|
||||
if (!post) throw error(404, 'Статья не найдена');
|
||||
return { post };
|
||||
};
|
||||
Reference in New Issue
Block a user