From 5c591899a15d0544cec9f257a6126d7d350b5699 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 13 Oct 2025 05:32:33 +0000 Subject: [PATCH] Enable sending multiple photos as individual stories on Facebook Update FacebookService to publish each media item in mediaList as a separate story, returning a comma-separated string of story IDs. 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/mIWJXC9 --- server/services/facebook.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/server/services/facebook.ts b/server/services/facebook.ts index 8cd7201..c9bd254 100644 --- a/server/services/facebook.ts +++ b/server/services/facebook.ts @@ -38,11 +38,20 @@ export class FacebookService { } if (postType === 'story') { - // Publish as story only + // Publish as story - one story per media if (mediaList.length === 0) { throw new Error('Stories require media (photo or video)'); } - return await this.publishStory(post, page, mediaList[0]); + + // Publish each media as a separate story + const storyIds: string[] = []; + for (const media of mediaList) { + const storyId = await this.publishStory(post, page, media); + storyIds.push(storyId); + } + + // Return all story IDs joined together + return storyIds.join(','); } else { // Default to feed // Count images only (videos not supported in multi-photo carousel)