Enable scheduling and posting to Facebook and Instagram pages

Fix bug in post creation to correctly handle media, page selection, and scheduling for social media posts.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/sjuGm8z
This commit is contained in:
michaelschal committed 2025-10-02 13:25:56 +00:00
1 parent f07f897ce0
commit e5123fbb27
3 files changed
+45 -3

No files matched your search

+12
View File
@@ -106,9 +106,21 @@ export default function NewPost() {
return;
}
if (selectedPages.length === 0) {
toast({
title: "Page requise",
description: "Veuillez sélectionner au moins une page",
variant: "destructive",
});
return;
}
createPostMutation.mutate({
content: postText,
scheduledFor: scheduledDate || undefined,
mediaId: selectedMedia || undefined,
pageIds: selectedPages,
postType: 'feed', // Default to feed post
});
};