From 4f79cc1c2afa035e089f89b658749624fd744529 Mon Sep 17 00:00:00 2001 From: Cason Kervis Date: Tue, 29 Jul 2025 10:15:10 +0800 Subject: [PATCH] fix(routes/landiannews): fix _embed search params (#19710) --- lib/routes/landiannews/category.ts | 2 +- lib/routes/landiannews/index.ts | 2 +- lib/routes/landiannews/tag.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/routes/landiannews/category.ts b/lib/routes/landiannews/category.ts index ab1a2cd4b..b660184a7 100644 --- a/lib/routes/landiannews/category.ts +++ b/lib/routes/landiannews/category.ts @@ -7,7 +7,7 @@ export const handler = async (ctx): Promise => { const { id, name } = await fetchCategory(slug); const rootUrl = 'https://www.landiannews.com/'; - const postApiUrl = `${rootUrl}wp-json/wp/v2/posts?_embed&categories=${id}`; + const postApiUrl = `${rootUrl}wp-json/wp/v2/posts?_embed=author,wp:term&categories=${id}`; const items: DataItem[] = await fetchNewsItems(postApiUrl); diff --git a/lib/routes/landiannews/index.ts b/lib/routes/landiannews/index.ts index 013850d51..641829ccd 100644 --- a/lib/routes/landiannews/index.ts +++ b/lib/routes/landiannews/index.ts @@ -3,7 +3,7 @@ import { fetchNewsItems } from './utils'; export const handler = async (): Promise => { const rootUrl = 'https://www.landiannews.com/'; - const postApiUrl = `${rootUrl}wp-json/wp/v2/posts?_embed`; + const postApiUrl = `${rootUrl}wp-json/wp/v2/posts?_embed=author,wp:term`; const items: DataItem[] = await fetchNewsItems(postApiUrl); diff --git a/lib/routes/landiannews/tag.ts b/lib/routes/landiannews/tag.ts index 187bb8a3a..f7d225b83 100644 --- a/lib/routes/landiannews/tag.ts +++ b/lib/routes/landiannews/tag.ts @@ -7,7 +7,7 @@ export const handler = async (ctx): Promise => { const { id, name } = await fetchTag(slug); const rootUrl = 'https://www.landiannews.com/'; - const postApiUrl = `${rootUrl}wp-json/wp/v2/posts?_embed&tags=${id}`; + const postApiUrl = `${rootUrl}wp-json/wp/v2/posts?_embed=author,wp:term&tags=${id}`; const items: DataItem[] = await fetchNewsItems(postApiUrl);