/api/trainings[
{
"id": "cm1x2y3z4a5b6c7d8e9f0g1h",
"title": "React Development Bootcamp",
"description": "Learn modern React development with hooks and context",
"duration": 40,
"level": "intermediate",
"category": "Web Development",
"company": "TechCorp",
"createdAt": "2024-01-15T10:30:00.000Z",
"author": {
"id": "demo-user-id",
"name": "Demo User",
"email": "demo@example.com"
},
"_count": {
"applicants": 5
}
}
]curl -X GET "http://localhost:3000/api/trainings" \
-H "Content-Type: application/json"/api/trainings/{id}{
"id": "cm1x2y3z4a5b6c7d8e9f0g1h",
"title": "React Development Bootcamp",
"description": "Learn modern React development with hooks and context",
"duration": 40,
"level": "intermediate",
"category": "Web Development",
"company": "TechCorp",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"authorId": "demo-user-id",
"author": {
"id": "demo-user-id",
"name": "Demo User",
"email": "demo@example.com"
},
"applicants": [],
"_count": {
"applicants": 0
}
}curl -X GET "http://localhost:3000/api/trainings/cm1x2y3z4a5b6c7d8e9f0g1h" \
-H "Content-Type: application/json"/api/trainings{
"title": "Advanced JavaScript",
"description": "Deep dive into JavaScript concepts and patterns",
"duration": 30,
"level": "advanced",
"category": "Programming",
"company": "CodeAcademy"
}{
"id": "cm2x3y4z5a6b7c8d9e0f1g2h",
"title": "Advanced JavaScript",
"description": "Deep dive into JavaScript concepts and patterns",
"duration": 30,
"level": "advanced",
"category": "Programming",
"company": "CodeAcademy",
"createdAt": "2024-01-15T10:30:00.000Z",
"author": {
"id": "demo-user-id",
"name": "Demo User",
"email": "demo@example.com"
}
}curl -X POST "http://localhost:3000/api/trainings" \
-H "Content-Type: application/json" \
-d '{
"title": "Advanced JavaScript",
"description": "Deep dive into JavaScript concepts and patterns",
"duration": 30,
"level": "advanced",
"category": "Programming",
"company": "CodeAcademy"
}'/api/trainings/{id}{
"message": "Training deleted successfully"
}curl -X DELETE "http://localhost:3000/api/trainings/cm1x2y3z4a5b6c7d8e9f0g1h" \
-H "Content-Type: application/json"/api/trainings/{id}/apply{
"applicantName": "John Doe",
"applicantEmail": "john@example.com",
"applicantPhone": "+1234567890"
}{
"id": "cm3x4y5z6a7b8c9d0e1f2g3h",
"status": "applied",
"appliedAt": "2024-01-15T10:30:00.000Z",
"applicantName": "John Doe",
"applicantEmail": "john@example.com",
"applicantPhone": "+1234567890",
"user": {
"id": "demo-user-id",
"name": "Demo User",
"email": "demo@example.com"
},
"training": {
"id": "cm1x2y3z4a5b6c7d8e9f0g1h",
"title": "React Development Bootcamp"
}
}curl -X POST "http://localhost:3000/api/trainings/cm1x2y3z4a5b6c7d8e9f0g1h/apply" \
-H "Content-Type: application/json" \
-d '{
"applicantName": "John Doe",
"applicantEmail": "john@example.com",
"applicantPhone": "+1234567890"
}'/api/trainings/{id}/applicants[
{
"id": "cm3x4y5z6a7b8c9d0e1f2g3h",
"status": "applied",
"appliedAt": "2024-01-15T10:30:00.000Z",
"applicantName": "John Doe",
"applicantEmail": "john@example.com",
"applicantPhone": "+1234567890"
}
]curl -X GET "http://localhost:3000/api/trainings/cm1x2y3z4a5b6c7d8e9f0g1h/applicants" \
-H "Content-Type: application/json"/api/applicants/{id}{
"message": "Applicant deleted successfully"
}curl -X DELETE "http://localhost:3000/api/applicants/cm3x4y5z6a7b8c9d0e1f2g3h" \
-H "Content-Type: application/json"Training Management API