Skip to content

Commit 76f4d7f

Browse files
Added the proper types
1 parent d72d69c commit 76f4d7f

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/routes/blog/index.json.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2+
import type { IBlog } from '$lib/models/interfaces/iblog.interface';
23
import { slugFromPath } from '$utils/slug-from-path';
34

45
/** @type {import('@sveltejs/kit').RequestHandler} */
5-
export async function get({ query }) {
6+
export async function get({ query }: { query: URLSearchParams }): Promise<Partial<{ body: IBlog[]; status: number }>> {
67
const modules = import.meta.glob('./**/index.{md,svx,svelte.md}');
78

89
const postPromises = [];
@@ -39,5 +40,6 @@ export async function get({ query }) {
3940

4041
return {
4142
body: publishedPosts.slice(0, sliceParam),
43+
status: 200,
4244
};
4345
}

src/routes/snippets/index.json.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2+
import type { ISnippet } from '$lib/models/interfaces/isnippet.interface';
23
import { slugFromPath } from '$utils/slug-from-path';
34

45
/** @type {import('@sveltejs/kit').RequestHandler} */
5-
export async function get({ query }) {
6+
export async function get({
7+
query,
8+
}: {
9+
query: URLSearchParams;
10+
}): Promise<Partial<{ body: ISnippet[]; status: number }>> {
611
const modules = import.meta.glob('./**/index.{md,svx,svelte.md}');
712

813
const snipptePromises = [];

src/routes/tags/index.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @type {import('@sveltejs/kit').Load}
44
*/
5-
export async function load({ fetch }) {
5+
export async function load({ fetch }: LoadInput) {
66
return {
77
props: {
88
blogs: await fetch('/blog.json').then((res) => res.json()),
@@ -13,12 +13,12 @@
1313

1414
<script lang="ts">
1515
// Start: Local Imports
16+
import type { LoadInput } from '@sveltejs/kit';
1617
// Components
1718
import HeadTags from '$components/head-tags/HeadTags.svelte';
1819
1920
// Models
2021
import type { IBlog } from '$models/interfaces/iblog.interface';
21-
import type { IMetaTagProperties } from '$models/interfaces/imeta-tag-properties.interface';
2222
2323
import { convertToSlug } from '$utils/convert-to-slug';
2424
// End: Local Imports

0 commit comments

Comments
 (0)