From 2e2949be27d0a653653ed7e1eb4daeb692a2109f Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Thu, 9 Oct 2025 13:38:38 +0000 Subject: [PATCH] Update scheduled posts calendar to automatically display new posts Invalidates the '/api/scheduled-posts' query cache on successful post creation to trigger a refetch and update the UI, resolving the need for manual page reloads. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/Z1TMYri --- .replit | 4 ---- client/src/pages/new-post.tsx | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.replit b/.replit index ad7eeab..7bce39b 100644 --- a/.replit +++ b/.replit @@ -34,10 +34,6 @@ externalPort = 5000 localPort = 37659 externalPort = 4200 -[[ports]] -localPort = 39387 -externalPort = 8008 - [[ports]] localPort = 40537 externalPort = 3000 diff --git a/client/src/pages/new-post.tsx b/client/src/pages/new-post.tsx index 03de55e..b8dd866 100644 --- a/client/src/pages/new-post.tsx +++ b/client/src/pages/new-post.tsx @@ -213,7 +213,8 @@ export default function NewPost() { const createPostMutation = useMutation({ mutationFn: (data: any) => apiRequest('POST', '/api/posts', data), - onSuccess: () => { + onSuccess: async () => { + await queryClient.invalidateQueries({ queryKey: ['/api/scheduled-posts'], refetchType: 'all' }); toast({ title: "Publication créée", description: "La publication a été créée avec succès",