mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-22 14:38:11 +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
@@ -34,10 +34,6 @@ externalPort = 5000
|
|||||||
localPort = 37659
|
localPort = 37659
|
||||||
externalPort = 4200
|
externalPort = 4200
|
||||||
|
|
||||||
[[ports]]
|
|
||||||
localPort = 39387
|
|
||||||
externalPort = 8008
|
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 40537
|
localPort = 40537
|
||||||
externalPort = 3000
|
externalPort = 3000
|
||||||
|
|||||||
@@ -213,7 +213,8 @@ export default function NewPost() {
|
|||||||
const createPostMutation = useMutation({
|
const createPostMutation = useMutation({
|
||||||
mutationFn: (data: any) =>
|
mutationFn: (data: any) =>
|
||||||
apiRequest('POST', '/api/posts', data),
|
apiRequest('POST', '/api/posts', data),
|
||||||
onSuccess: () => {
|
onSuccess: async () => {
|
||||||
|
await queryClient.invalidateQueries({ queryKey: ['/api/scheduled-posts'], refetchType: 'all' });
|
||||||
toast({
|
toast({
|
||||||
title: "Publication créée",
|
title: "Publication créée",
|
||||||
description: "La publication a été créée avec succès",
|
description: "La publication a été créée avec succès",
|
||||||
|
|||||||
Reference in new issue
Block a user