mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Add TypeScript definitions via pg-to-ts and refactor migrations
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Actions, PageServerLoad } from "./$types";
|
||||
import { API_BASE_PREFIX } from "$lib/server/utils";
|
||||
import type { Article, DocsCategory } from "$lib/db-schema";
|
||||
|
||||
export const load: PageServerLoad = async ({ parent, params, cookies, fetch }) => {
|
||||
const articleData = await fetch(`${API_BASE_PREFIX}/article?id=eq.${params.articleId}`, {
|
||||
@@ -22,8 +23,8 @@ export const load: PageServerLoad = async ({ parent, params, cookies, fetch }) =
|
||||
}
|
||||
);
|
||||
|
||||
const article = await articleData.json();
|
||||
const categories = await categoryData.json();
|
||||
const article: Article = await articleData.json();
|
||||
const categories: DocsCategory[] = await categoryData.json();
|
||||
const { website } = await parent();
|
||||
|
||||
return { website, article, categories, API_BASE_PREFIX };
|
||||
|
||||
Reference in New Issue
Block a user