⚙️ Fix types.

This commit is contained in:
pheralb 2023-06-11 12:41:09 +01:00
parent 76cabd2923
commit 874876fc8e
2 changed files with 5 additions and 6 deletions

View File

@ -1,9 +1,10 @@
<script lang="ts"> <script lang="ts">
import type { PageData } from './$types'; import type { PageData } from './$types';
import type { iSVG } from '@/types/svg'; import type { iSVG } from '@/types/svg';
export let data: PageData; export let data: PageData;
let svgsByCategory = data.props?.svgs || []; let svgsByCategory = data.svgs || [];
let category = data.props?.category || ''; let category = data.category || '';
// Components: // Components:
import Container from '@/components/container.svelte'; import Container from '@/components/container.svelte';

View File

@ -16,9 +16,7 @@ export const load = (async ({ params }) => {
const svgsByCategory = svgs.filter((svg: iSVG) => svg.category.toLowerCase() === slug); const svgsByCategory = svgs.filter((svg: iSVG) => svg.category.toLowerCase() === slug);
return { return {
props: { category: slug as string,
category: slug, svgs: svgsByCategory
svgs: svgsByCategory
}
}; };
}) satisfies PageLoad; }) satisfies PageLoad;