From 39362851ee687488eacfea8b5ca6a7f2f7a666c2 Mon Sep 17 00:00:00 2001 From: Nishant Singh <57475999+Rjnishant530@users.noreply.github.com> Date: Fri, 1 Aug 2025 19:13:24 +0530 Subject: [PATCH] fix(route/grist): payload changed (#19717) * fix grist * remove a line --- lib/routes/grist/utils.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/routes/grist/utils.ts b/lib/routes/grist/utils.ts index c93f18328..ceec0009b 100644 --- a/lib/routes/grist/utils.ts +++ b/lib/routes/grist/utils.ts @@ -6,16 +6,17 @@ const getData = (url) => ofetch(url); const getList = (data) => data.map((value) => { - const { id, title, content, date_gmt, modified_gmt, link, parsely, _embedded } = value; - const { image, author } = parsely.meta; + const { id, title, content, date_gmt, modified_gmt, link, _embedded, featured_media } = value; + const { 'wp:featuredmedia': media, author } = _embedded; + const image = media?.find((v) => v.id === featured_media) || { source_url: '' }; return { id, title: title.rendered, description: content.rendered, link, - itunes_item_image: image.url, + itunes_item_image: image.source_url, category: _embedded['wp:term'][0].map((v) => v.name), - author: author.map((v) => v.name).join(', '), + author: author?.map((v) => v.name).join(', '), pubDate: timezone(parseDate(date_gmt), 0), updated: timezone(parseDate(modified_gmt), 0), };