Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

chore: return non-null blog posts

Marc Seitzd1b57220c5c1
diff --git a/lib/content/blog.ts b/lib/content/blog.ts
index d6ea112a..da20f4f0 100644
--- a/lib/content/blog.ts
+++ b/lib/content/blog.ts
@@ -28,7 +28,7 @@ export const getPostsRemote = cache(async () => {
const response = await fetch(apiUrl, { headers });
const data = await response.json();
- return Promise.all(
+ const posts = await Promise.all(
data
.filter((file: any) => file.name.endsWith(".mdx"))
.map(async (file: any) => {
@@ -45,6 +45,9 @@ export const getPostsRemote = cache(async () => {
return { data, body: fileContent } as Post;
}),
);
+
+ const filteredPosts = posts.filter((post: Post) => post !== null) as Post[];
+ return filteredPosts;
});
export async function getPost(slug: string) {