Refactor event handling and user management: Replace direct database calls with service layer methods for events, user profiles, and preferences, enhancing code organization and maintainability. Update API routes to utilize new services for event registration, feedback, and user statistics, ensuring a consistent approach across the application.

This commit is contained in:
Julien Froidefond
2025-12-12 16:19:13 +01:00
parent fd095246a3
commit 494ac3f503
34 changed files with 1795 additions and 1096 deletions

View File

@@ -1,18 +1,13 @@
import NavigationWrapper from "@/components/NavigationWrapper";
import HeroSection from "@/components/HeroSection";
import EventsSection from "@/components/EventsSection";
import { prisma } from "@/lib/prisma";
import { eventService } from "@/services/events/event.service";
import { getBackgroundImage } from "@/lib/preferences";
export const dynamic = "force-dynamic";
export default async function Home() {
const events = await prisma.event.findMany({
orderBy: {
date: "asc",
},
take: 3,
});
const events = await eventService.getUpcomingEvents(3);
// Convert Date objects to strings for serialization
const serializedEvents = events.map((event) => ({