feat: update Daily management features and enhance date handling

- Marked the calendar/history view of dailies as completed in the TODO list.
- Improved date formatting in `formatDateForAPI` to avoid timezone issues.
- Added `getDailyDates` method in `DailyClient` and `DailyService` to retrieve all dates with dailies.
- Enhanced `POST` route to robustly parse date input for better error handling.
- Integrated daily dates loading in `DailyPageClient` for calendar display.
This commit is contained in:
Julien Froidefond
2025-09-15 18:21:48 +02:00
parent cf2e360ce9
commit 936e0306fc
8 changed files with 381 additions and 46 deletions

View File

@@ -0,0 +1,20 @@
import { NextResponse } from 'next/server';
import { dailyService } from '@/services/daily';
/**
* API route pour récupérer toutes les dates avec des dailies
* GET /api/daily/dates
*/
export async function GET() {
try {
const dates = await dailyService.getDailyDates();
return NextResponse.json({ dates });
} catch (error) {
console.error('Erreur lors de la récupération des dates:', error);
return NextResponse.json(
{ error: 'Erreur interne du serveur' },
{ status: 500 }
);
}
}