From 5907eca04b32798f0ee11743baee8025c1ca0a02 Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Tue, 27 Sep 2022 02:06:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E5=8D=8E=E5=B0=94=E8=A1=97?= =?UTF-8?q?=E8=A7=81=E9=97=BB=E7=A7=BB=E9=99=A4=E5=B9=BF=E5=91=8A=20(#1091?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/v2/wallstreetcn/news.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/v2/wallstreetcn/news.js b/lib/v2/wallstreetcn/news.js index 90ca8248e..e7f6e05ba 100644 --- a/lib/v2/wallstreetcn/news.js +++ b/lib/v2/wallstreetcn/news.js @@ -28,12 +28,14 @@ module.exports = async (ctx) => { url: apiUrl, }); - let items = response.data.data.items.map((item) => ({ - type: item.resource_type, - guid: item.resource.id, - link: item.resource.uri, - pubDate: parseDate(item.resource.display_time * 1000), - })); + let items = response.data.data.items + .filter((item) => item.resource_type !== 'ad') + .map((item) => ({ + type: item.resource_type, + guid: item.resource.id, + link: item.resource.uri, + pubDate: parseDate(item.resource.display_time * 1000), + })); items = await Promise.all( items.map((item) =>