mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
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
This commit is contained in:
1 parent
7517df10e4
commit
2e2949be27
2 files changed
+2
-5
No files matched your search
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user