From f1590f52e818a03132d4e9a94b6e7a710287d35b Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 19 Jan 2022 11:27:09 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20rss=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/feed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/feed.js b/pages/feed.js index ece3a3f4..3e3ebffa 100644 --- a/pages/feed.js +++ b/pages/feed.js @@ -3,8 +3,8 @@ import { getGlobalNotionData } from '@/lib/notion/getNotionData' export async function getServerSideProps ({ res }) { res.setHeader('Content-Type', 'text/xml') - const { allPosts } = getGlobalNotionData({ from: 'rss' }) - const xmlFeed = generateRss(allPosts.slice(0, 10)) + const globalNotionData = await getGlobalNotionData({ from: 'rss' }) + const xmlFeed = generateRss(globalNotionData?.allPosts?.slice(0, 10) || []) res.write(xmlFeed) res.end() return {