Refactor event date handling: Update event model to use DateTime type for date fields in Prisma schema. Modify API routes and UI components to ensure consistent date formatting and handling, improving data integrity and user experience across event management and display.
This commit is contained in:
@@ -11,6 +11,14 @@ export default async function EventsPage() {
|
||||
},
|
||||
});
|
||||
|
||||
// Sérialiser les dates pour le client
|
||||
const serializedEvents = events.map((event) => ({
|
||||
...event,
|
||||
date: event.date.toISOString(),
|
||||
createdAt: event.createdAt.toISOString(),
|
||||
updatedAt: event.updatedAt.toISOString(),
|
||||
}));
|
||||
|
||||
const backgroundImage = await getBackgroundImage("events", "/got-2.jpg");
|
||||
|
||||
// Récupérer les inscriptions côté serveur pour éviter le clignotement
|
||||
@@ -44,7 +52,7 @@ export default async function EventsPage() {
|
||||
<main className="min-h-screen bg-black relative">
|
||||
<NavigationWrapper />
|
||||
<EventsPageSection
|
||||
events={events}
|
||||
events={serializedEvents}
|
||||
backgroundImage={backgroundImage}
|
||||
initialRegistrations={initialRegistrations}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user