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:
@@ -144,13 +144,9 @@ export default function ComposeScreen() {
|
||||
shortLink: false,
|
||||
tags: [] as string[],
|
||||
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 {
|
||||
integration: { id: integrationId },
|
||||
value: [valueItem],
|
||||
value: [{ content: content.trim(), image: media }],
|
||||
};
|
||||
}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user