Skip to main content

get_course_students_page

Function get_course_students_page 

Source
pub async fn get_course_students_page(
    conn: &mut PgConnection,
    course_id: Uuid,
    pagination: Pagination,
    search: Option<&str>,
    sort_column: Option<&str>,
    sort_direction: Option<&str>,
    course_instance_id: Option<Uuid>,
) -> ModelResult<StudentsListPage>
Expand description

Returns a filtered, sorted, paginated page of the course’s enrolled users (identity only).

sort_column (last_name | first_name | email) and sort_direction map to fixed SQL fragments, never interpolated from raw input. search matches name/email substrings via the trigram name_search_helper / email_search_helper columns, plus an exact user-id match when it parses as a UUID. course_instance_id narrows to a single instance.