feat: implement 'not_started' task status with validation and UI updates

This commit is contained in:
2025-10-07 23:07:15 +02:00
parent a6ef325813
commit 33c5466d77
6 changed files with 31 additions and 4 deletions

View File

@@ -49,6 +49,14 @@ async function updateProjectTaskStatusHandler(req, { params }) {
);
}
const allowedStatuses = ['not_started', 'pending', 'in_progress', 'completed', 'cancelled'];
if (!allowedStatuses.includes(status)) {
return NextResponse.json(
{ error: "Invalid status. Must be one of: " + allowedStatuses.join(', ') },
{ status: 400 }
);
}
updateProjectTaskStatus(id, status, req.user?.id || null);
return NextResponse.json({ success: true });
} catch (error) {