diff --git a/src/libs/utils/notion/filterPosts.ts b/src/libs/utils/notion/filterPosts.ts index f13d200ac..49bb5f97f 100644 --- a/src/libs/utils/notion/filterPosts.ts +++ b/src/libs/utils/notion/filterPosts.ts @@ -23,7 +23,7 @@ export function filterPosts( // filter data .filter((post) => { const postDate = new Date(post?.date?.start_date || post.createdTime) - if (!post.title || !post.slug || postDate > tomorrow) return false + if (!post.title || postDate > tomorrow) return false return true }) // filter status @@ -36,5 +36,9 @@ export function filterPosts( const postType = post.type[0] return acceptType.includes(postType) }) + .map((post) => { + if (!post.slug) post.slug = post.id; + return post; + }) return filteredPosts }