From 3d07b9f87aebe79ed3a0dcf6cc0ded000c03fffa Mon Sep 17 00:00:00 2001 From: Fatpandac <1779196284@qq.com> Date: Wed, 2 Mar 2022 22:29:40 +0800 Subject: [PATCH] fix(route): odaily remove newflash from post (#9233) --- lib/v2/odaily/post.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/v2/odaily/post.js b/lib/v2/odaily/post.js index 5e99aad12..073e74e04 100644 --- a/lib/v2/odaily/post.js +++ b/lib/v2/odaily/post.js @@ -25,14 +25,16 @@ module.exports = async (ctx) => { url: currentUrl, }); - let items = response.data.data.items.map((item) => ({ - title: item.title, - author: item.user.name, - type: item.entity_type, - description: `
${item.summary}
`, - link: `${rootUrl}/${item.entity_type}/${item.entity_id}`, - pubDate: timezone(parseDate(item.published_at), +8), - })); + let items = response.data.data.items + .map((item) => ({ + title: item.title, + author: item.user.name, + type: item.entity_type, + description: `${item.summary}
`, + link: `${rootUrl}/${item.entity_type}/${item.entity_id}`, + pubDate: timezone(parseDate(item.published_at), +8), + })) + .filter((item) => item.type !== 'newsflash'); items = await Promise.all( items.map(