Skip to content

Commit

Permalink
fix(route/apnews): Guess the link if absent from entry
Browse files Browse the repository at this point in the history
  • Loading branch information
dzx-dzx committed Nov 13, 2024
1 parent f6c2ebb commit 7bb5731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/routes/apnews/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 7bb5731

Please sign in to comment.