diff --git a/client/src/pages/admin.tsx b/client/src/pages/admin.tsx index 33a1564..914f468 100644 --- a/client/src/pages/admin.tsx +++ b/client/src/pages/admin.tsx @@ -209,6 +209,7 @@ function EditVideoDialog({ onSuccess: () => void; }) { const { toast } = useToast(); + const queryClient = useQueryClient(); const [formData, setFormData] = useState({ title: video.title, description: video.description, @@ -225,6 +226,10 @@ function EditVideoDialog({ title: "Success", description: "Video updated successfully", }); + // Invalidate cache to refresh the video list + queryClient.invalidateQueries({ queryKey: ["/api/admin/videos"] }); + queryClient.invalidateQueries({ queryKey: ["/api/videos"] }); + onOpenChange(false); onSuccess(); }, onError: (error: any) => {