mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
5d7ab93bf8
commit
b8dc93eb2d
2 files changed
+4
-2
No files matched your search
@@ -13,7 +13,7 @@ import Sidebar from "@/components/sidebar";
|
|||||||
import { Checkbox } from "@/components/ui/checkbox";
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
import { DateTimePicker } from "@/components/datetime-picker";
|
import { DateTimePicker } from "@/components/datetime-picker";
|
||||||
import { useQuery, useMutation } from "@tanstack/react-query";
|
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";
|
import type { Media, SocialPage } from "@shared/schema";
|
||||||
|
|
||||||
interface AudioTrack { id: string; title: string; fileName: string; url: string; duration: number; }
|
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 !",
|
title: scheduledDate ? "Publication planifiée !" : "Vidéo publiée !",
|
||||||
description: scheduledDate ? `Sera publiée le ${scheduledDate.toLocaleString('fr-FR')}` : "Publiée sur Facebook.",
|
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) {
|
} catch (err: any) {
|
||||||
toast({ title: "Erreur de publication", description: err.message, variant: "destructive" });
|
toast({ title: "Erreur de publication", description: err.message, variant: "destructive" });
|
||||||
} finally { setIsPublishing(false); }
|
} finally { setIsPublishing(false); }
|
||||||
|
|||||||
@@ -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 { UploadCloud, Video, Loader2, Check, Sparkles, Mic, Volume2, Music, Play, Pause, Send } from "lucide-react";
|
||||||
import { Slider } from "@/components/ui/slider";
|
import { Slider } from "@/components/ui/slider";
|
||||||
import { useQuery, useMutation } from "@tanstack/react-query";
|
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 { Label } from "@/components/ui/label";
|
||||||
import { Switch } from "@/components/ui/switch";
|
import { Switch } from "@/components/ui/switch";
|
||||||
import { Checkbox } from "@/components/ui/checkbox";
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
@@ -139,6 +139,7 @@ export default function RemotionVideoPage() {
|
|||||||
title: scheduledDate ? "Publication planifiée !" : "Vidéo publiée !",
|
title: scheduledDate ? "Publication planifiée !" : "Vidéo publiée !",
|
||||||
description: scheduledDate ? `Sera publiée le ${scheduledDate.toLocaleString('fr-FR')}` : "Publiée sur Facebook.",
|
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) {
|
} catch (err: any) {
|
||||||
toast({ title: "Erreur de publication", description: err.message, variant: "destructive" });
|
toast({ title: "Erreur de publication", description: err.message, variant: "destructive" });
|
||||||
} finally { setIsPublishing(false); }
|
} finally { setIsPublishing(false); }
|
||||||
|
|||||||
Reference in new issue
Block a user