async fn show_teacher_sync_tasks_summary(
    class_id: i32,
    conn: &Database,
) -> LovelaceResult<Vec<(ClassSynchronousTask, User)>> {
    use crate::schema::class_synchronous_task::dsl as class_synchronous_task;
    use crate::schema::class_teacher::dsl as class_teacher;
    use crate::schema::student_class_synchronous_task::dsl as student_class_synchronous_task;
    let query = class_synchronous_task::class_synchronous_task
        .filter(class_synchronous_task::class_id.eq(class_id))
        .order_by(class_synchronous_task::start_time.desc())
        .inner_join(student_class_synchronous_task::student_class_synchronous_task);
    conn.run(move |c| {
        query
            .inner_join(class_teacher::class_teacher.inner_join(crate::schema::users::dsl::users))
            .select((
                crate::schema::class_synchronous_task::all_columns,
                crate::schema::users::all_columns,
            ))
            .load::<(ClassSynchronousTask, User)>(c)
    })
    .await
    .map_err(|e| {
        error!("{:#?}", e);
        LovelaceError::DatabaseError
    })
}
/// Show the list of tasks that have been set in a class. At some point we'll want to add pagination
/// support for this.
///
/// MAKE SURE YOU HAVE CHECKED THAT THE USER IS A TEACHER IN THE CLASS BEFORE YOU CALL THIS
/// FUNCTION. (sorry for the all caps, I (@teymour-aldridge) kept forgetting to do so :-)
Show the list of tasks that have been set in a class. At some point we'll want to add pagination
support for this.


Show the list of tasks that have been set in a class . At some point we ' ll want to add pagination support for this .
async fn show_teacher_sync_tasks_summary(
    class_id: i32,
    conn: &Database,
) -> LovelaceResult<Vec<(ClassSynchronousTask, User)>> {
    use crate::schema::class_synchronous_task::dsl as class_synchronous_task;
    use crate::schema::class_teacher::dsl as class_teacher;
    use crate::schema::student_class_synchronous_task::dsl as student_class_synchronous_task;
    let query = class_synchronous_task::class_synchronous_task
        .filter(class_synchronous_task::class_id.eq(class_id))
        .order_by(class_synchronous_task::start_time.desc())
        .inner_join(student_class_synchronous_task::student_class_synchronous_task);
    conn.run(move |c| {
        query
            .inner_join(class_teacher::class_teacher.inner_join(crate::schema::users::dsl::users))
            .select((
                crate::schema::class_synchronous_task::all_columns,
                crate::schema::users::all_columns,
            ))
            .load::<(ClassSynchronousTask, User)>(c)
    })
    .await
    .map_err(|e| {
        error!("{:#?}", e);
        LovelaceError::DatabaseError
    })
}
async fn show_teacher_sync_tasks_summary ( class_id : i32 , conn : & Database , ) -> LovelaceResult < Vec < ( ClassSynchronousTask , User ) > > { use crate :: schema :: class_synchronous_task :: dsl as class_synchronous_task ; use crate :: schema :: class_teacher :: dsl as class_teacher ; use crate :: schema :: student_class_synchronous_task :: dsl as student_class_synchronous_task ; let query = class_synchronous_task :: class_synchronous_task . filter ( class_synchronous_task :: class_id . eq ( class_id ) ) . order_by ( class_synchronous_task :: start_time . desc ( ) ) . inner_join ( student_class_synchronous_task :: student_class_synchronous_task ) ; conn . run ( move | c | { query . inner_join ( class_teacher :: class_teacher . inner_join ( crate :: schema :: users :: dsl :: users ) ) . select ( ( crate :: schema :: class_synchronous_task :: all_columns , crate :: schema :: users :: all_columns , ) ) . load :: < ( ClassSynchronousTask , User ) > ( c ) } ) . await . map_err ( | e | { error ! ( " " e ) ; LovelaceError :: DatabaseError } ) }
Show the list of tasks that have been set in a class.
Show the list of tasks that have been set in a class .
class_id
i32
conn
&Database