mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 20:26:28 -06:00
refactor: use common TagChip, switch to SSR for admin pages, better error & logger handling
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import { apiFetch } from "$lib/api.server";
|
||||
import { addIconsToTags } from "$lib/server/tag-icons";
|
||||
import type { AdminTagWithCount } from "$lib/admin-types";
|
||||
|
||||
export const load: PageServerLoad = async ({ fetch }) => {
|
||||
const tagsWithCounts = await apiFetch<AdminTagWithCount[]>("/api/tags", {
|
||||
fetch,
|
||||
});
|
||||
|
||||
// Add icons to tags
|
||||
const availableTags = await addIconsToTags(tagsWithCounts);
|
||||
|
||||
return {
|
||||
availableTags,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user