fix: always include image array in post value to satisfy Postiz API validation

Postiz requires posts[].value[].image to always be an array. Omitting it
when no image is selected was causing a 400 Bad Request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
billisdead
2026-05-22 09:16:07 +02:00
parent 554b16d6cb
commit e1a294fc96
@@ -144,13 +144,9 @@ export default function ComposeScreen() {
shortLink: false, shortLink: false,
tags: [] as string[], tags: [] as string[],
posts: selectedChannels.map((integrationId) => { posts: selectedChannels.map((integrationId) => {
const valueItem: { content: string; image?: Array<{ id: string; path: string }> } = {
content: content.trim(),
};
if (media.length > 0) valueItem.image = media;
return { return {
integration: { id: integrationId }, integration: { id: integrationId },
value: [valueItem], value: [{ content: content.trim(), image: media }],
}; };
}), }),
}; };