fix(route/grist): payload changed (#19717)

* fix grist

* remove a line
This commit is contained in:
Nishant Singh 2025-08-01 19:13:24 +05:30 committed by GitHub
parent 4717c7db41
commit 39362851ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 4 deletions

View File

@ -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),
};