feat: add related todos functionality in task editing

- Implemented `RelatedTodos` component in `EditTaskForm` to display and manage related todos for a task.
- Updated `TasksClient` to fetch daily checkboxes related to a task.
- Enhanced `TasksService` with a method to retrieve related daily checkboxes from the database.
- Added functionality to create new todos linked to tasks in the daily actions.
- Marked the task for displaying related todos in the task editing interface as complete in TODO.md.
This commit is contained in:
Julien Froidefond
2025-09-18 15:26:07 +02:00
parent 729a04d557
commit 02f59caf08
7 changed files with 345 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
import { NextRequest, NextResponse } from 'next/server';
import { tasksService } from '@/services/tasks';
export async function GET(
request: NextRequest,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
if (!id) {
return NextResponse.json(
{ error: 'ID de tâche requis' },
{ status: 400 }
);
}
const checkboxes = await tasksService.getTaskRelatedCheckboxes(id);
return NextResponse.json({ data: checkboxes });
} catch (error) {
console.error('Erreur lors de la récupération des checkboxes:', error);
return NextResponse.json(
{ error: 'Erreur lors de la récupération des checkboxes' },
{ status: 500 }
);
}
}