fix(patreon): fix empty image (#18419)
This commit is contained in:
parent
cfe58ca805
commit
f6cb490fc8
|
|
@ -98,7 +98,7 @@ async function handler(ctx) {
|
|||
}
|
||||
}
|
||||
if (attributes.video_preview) {
|
||||
relationships.video_preview = posts.included.find((i) => Number.parseInt(i.id) === attributes.video_preview.media_id) as unknown as MediaRelation;
|
||||
relationships.video_preview = posts.included.find((i) => Number.parseInt(i.id) === attributes.video_preview?.media_id) as unknown as MediaRelation;
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
@ -110,7 +110,7 @@ async function handler(ctx) {
|
|||
}),
|
||||
link: attributes.url,
|
||||
pubDate: parseDate(attributes.published_at),
|
||||
image: attributes.thumbnail?.url ?? attributes.image.url,
|
||||
image: attributes.thumbnail?.url ?? attributes.image?.url,
|
||||
category: relationships.user_defined_tags?.map((tag) => tag.attributes.value),
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
{{ else if attributes.post_type === 'video_embed' || attributes.post_type === 'link' }}
|
||||
<img src="{{ attributes.image.url }}"><br>
|
||||
|
||||
{{ else if attributes.post_type === 'text_only' }}
|
||||
|
||||
{{ else }}
|
||||
Post type: "{{ attributes.post_type }}" is not supported. <br>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue