From 7bb573152da83911d6cff5f584f6a8150d85963d Mon Sep 17 00:00:00 2001 From: dzx-dzx Date: Wed, 13 Nov 2024 13:56:33 +0800 Subject: [PATCH] fix(route/apnews): Guess the link if absent from entry --- lib/routes/apnews/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/apnews/api.ts b/lib/routes/apnews/api.ts index f0edc8582bb5e3..22b60cbf6cc6cd 100644 --- a/lib/routes/apnews/api.ts +++ b/lib/routes/apnews/api.ts @@ -57,7 +57,7 @@ async function handler(ctx) { const list = res.cards .map((e) => ({ title: e.contents[0]?.headline, - link: e.contents[0]?.localLinkUrl, + link: e.contents[0]?.localLinkUrl ?? `https://apnews.com/${tags}-${e.contents[0]?.shortId}`, pubDate: timezone(parseDate(e.publishedDate), 0), category: e.tagObjs.map((tag) => tag.name), updated: timezone(parseDate(e.contents[0]?.updated), 0),