Merge pull request #51 from R0m1k3/dev

Dev
This commit is contained in:
LogiFlow authored and GitHub committed 2025-10-09 16:18:36 +02:00
commit c044221ea3
4 files changed
+14 -5

No files matched your search

-4
View File
@@ -34,10 +34,6 @@ externalPort = 5000
localPort = 37659
externalPort = 4200
[[ports]]
localPort = 39387
externalPort = 8008
[[ports]]
localPort = 40537
externalPort = 3000
+2 -1
View File
@@ -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",
+7
View File
@@ -8,6 +8,13 @@ Social Flow is a comprehensive social media automation platform designed to stre
Preferred communication style: Simple, everyday language.
## Recent Changes
### October 9, 2025
- **AI Variants Position**: Repositioned AI-generated text variations to display after "Contenu" card and before "Texte de la publication" card in new-post page for better workflow
- **Calendar Auto-Refresh**: Fixed calendar not updating after creating a new scheduled post. Added `queryClient.invalidateQueries` with `refetchType: 'all'` in `createPostMutation.onSuccess` to force cache invalidation and immediate refetch
- **Dashboard Scheduled Posts Count**: Fixed scheduled posts count showing 0 in dashboard. Problem was that posts with `scheduledFor` were created with status "draft" instead of "scheduled". Solution: POST /api/posts now sets `status = "scheduled"` when `scheduledFor` is provided. Legacy posts updated with SQL: `UPDATE posts SET status = 'scheduled' WHERE scheduled_for IS NOT NULL AND status = 'draft'`
## System Architecture
### Frontend Architecture
+5
View File
@@ -597,6 +597,11 @@ export async function registerRoutes(app: Express): Promise<Server> {
postFields.scheduledFor = new Date(postFields.scheduledFor);
}
// Set status to "scheduled" if scheduledFor is provided, otherwise "draft"
if (postFields.scheduledFor) {
postFields.status = "scheduled";
}
// Create the post
const postData = insertPostSchema.parse({ ...postFields, userId });
const post = await storage.createPost(postData);