Function headless_lms_server::controllers::main_frontend::courses::get_course_structure
source · async fn get_course_structure(
course_id: Path<Uuid>,
pool: Data<PgPool>,
user: AuthUser,
file_store: Data<dyn FileStore>,
app_conf: Data<ApplicationConfiguration>
) -> ControllerResult<Json<CourseStructure>>
Expand description
GET /api/v0/main-frontend/courses/:course_id/structure
- Returns the structure of a course.
Example
{
"course": {
"id": "d86cf910-4d26-40e9-8c9c-1cc35294fdbb",
"slug": "introduction-to-everything",
"created_at": "2021-04-28T10:40:54.503917",
"updated_at": "2021-04-28T10:40:54.503917",
"name": "Introduction to everything",
"organization_id": "1b89e57e-8b57-42f2-9fed-c7a6736e3eec",
"deleted_at": null,
"language_code": "en-US",
"copied_from": null,
"language_version_of_course_id": null
},
"pages": [
{
"id": "f3b0d699-c9be-4d56-bd0a-9d40e5547e4d",
"created_at": "2021-04-28T13:51:51.024118",
"updated_at": "2021-04-28T14:36:18.179490",
"course_id": "d86cf910-4d26-40e9-8c9c-1cc35294fdbb",
"content": [],
"url_path": "/",
"title": "Welcome to Introduction to Everything",
"deleted_at": null,
"chapter_id": "d332f3d9-39a5-4a18-80f4-251727693c37"
}
],
"chapters": [
{
"id": "d332f3d9-39a5-4a18-80f4-251727693c37",
"created_at": "2021-04-28T16:11:47.477850",
"updated_at": "2021-04-28T16:11:47.477850",
"name": "The Basics",
"course_id": "d86cf910-4d26-40e9-8c9c-1cc35294fdbb",
"deleted_at": null,
"chapter_image_url": "http://project-331.local/api/v0/files/uploads/organizations/1b89e57e-8b57-42f2-9fed-c7a6736e3eec/courses/d86cf910-4d26-40e9-8c9c-1cc35294fdbb/images/mbPQh8th96TdUwX96Y0ch1fjbJLRFr.png",
"chapter_number": 1,
"front_page_id": null
}
]
}