From b8dc93eb2da0f72701e8f7fc1564607de3d797b0 Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Wed, 25 Mar 2026 17:11:58 +0100 Subject: [PATCH] fix: invalidate scheduled-posts cache after video publish/schedule Calendar now updates instantly without page reload after creating a video publication or scheduling from the Remotion generator. Co-Authored-By: Claude Sonnet 4.6 --- client/src/pages/mobile/remotion-video.tsx | 3 ++- client/src/pages/remotion-video.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/pages/mobile/remotion-video.tsx b/client/src/pages/mobile/remotion-video.tsx index 290fbda..84c6fab 100644 --- a/client/src/pages/mobile/remotion-video.tsx +++ b/client/src/pages/mobile/remotion-video.tsx @@ -13,7 +13,7 @@ import Sidebar from "@/components/sidebar"; import { Checkbox } from "@/components/ui/checkbox"; import { DateTimePicker } from "@/components/datetime-picker"; import { useQuery, useMutation } from "@tanstack/react-query"; -import { apiRequest } from "@/lib/queryClient"; +import { apiRequest, queryClient } from "@/lib/queryClient"; import type { Media, SocialPage } from "@shared/schema"; interface AudioTrack { id: string; title: string; fileName: string; url: string; duration: number; } @@ -155,6 +155,7 @@ export default function MobileRemotionVideoPage() { title: scheduledDate ? "Publication planifiée !" : "Vidéo publiée !", description: scheduledDate ? `Sera publiée le ${scheduledDate.toLocaleString('fr-FR')}` : "Publiée sur Facebook.", }); + await queryClient.invalidateQueries({ queryKey: ['/api/scheduled-posts'], refetchType: 'all' }); } catch (err: any) { toast({ title: "Erreur de publication", description: err.message, variant: "destructive" }); } finally { setIsPublishing(false); } diff --git a/client/src/pages/remotion-video.tsx b/client/src/pages/remotion-video.tsx index 15cdd51..46504c9 100644 --- a/client/src/pages/remotion-video.tsx +++ b/client/src/pages/remotion-video.tsx @@ -8,7 +8,7 @@ import { Textarea } from "@/components/ui/textarea"; import { UploadCloud, Video, Loader2, Check, Sparkles, Mic, Volume2, Music, Play, Pause, Send } from "lucide-react"; import { Slider } from "@/components/ui/slider"; import { useQuery, useMutation } from "@tanstack/react-query"; -import { apiRequest } from "@/lib/queryClient"; +import { apiRequest, queryClient } from "@/lib/queryClient"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { Checkbox } from "@/components/ui/checkbox"; @@ -139,6 +139,7 @@ export default function RemotionVideoPage() { title: scheduledDate ? "Publication planifiée !" : "Vidéo publiée !", description: scheduledDate ? `Sera publiée le ${scheduledDate.toLocaleString('fr-FR')}` : "Publiée sur Facebook.", }); + await queryClient.invalidateQueries({ queryKey: ['/api/scheduled-posts'], refetchType: 'all' }); } catch (err: any) { toast({ title: "Erreur de publication", description: err.message, variant: "destructive" }); } finally { setIsPublishing(false); }