diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 76f442b..2eafda1 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -1,12 +1,10 @@ -import type { LayoutLoad } from './$types'; +import type { LayoutLoad } from './$types' -export const load = (async ({ fetch, url }) => { - const blogPostsResponse = await fetch(`/blog/articles/pageSize/5.json`) +export const load = (async ({ fetch }) => { + const blogPostsResponse = await fetch(`/blog/articles/pageSize/5`) const blogPostsContent = await blogPostsResponse.json() return { latestPosts: blogPostsContent.posts.items, - // TODO Check if not bugged FIXME - segment: '', } }) satisfies LayoutLoad diff --git a/src/routes/blog/content.ts b/src/routes/blog/content.ts index fee0448..41a7bdf 100644 --- a/src/routes/blog/content.ts +++ b/src/routes/blog/content.ts @@ -55,7 +55,7 @@ export async function getBlogListing(paginationQuery: PaginationQuery) { const filteredContents = pipe( sortBy(prop('date')), (items) => reverse(items), - filter((article) => article.published), + filter<(typeof contents)[0]>((article) => article.published), filterAndCount(paginationQuery) )(contents)