async fn show_student_sync_tasks_summary(
    class_id: i32,
    user_id: i32,
    conn: &Database,
) -> LovelaceResult<Vec<(StudentClassSynchronousTask, ClassSynchronousTask)>> {
    use crate::schema::class_student::dsl as class_student;
    use crate::schema::class_synchronous_task::dsl as class_synchronous_task;
    use crate::schema::student_class_synchronous_task::dsl as student_class_synchronous_task;

    match conn
        .run(move |c| {
            student_class_synchronous_task::student_class_synchronous_task
                .inner_join(class_student::class_student)
                .filter(class_student::user_id.eq(user_id))
                .inner_join(class_synchronous_task::class_synchronous_task)
                .filter(class_synchronous_task::class_id.eq(class_id))
                .select((
                    crate::schema::student_class_synchronous_task::all_columns,
                    crate::schema::class_synchronous_task::all_columns,
                ))
                .load::<(StudentClassSynchronousTask, ClassSynchronousTask)>(c)
        })
        .await
    {
        Ok(tasks) => Ok(tasks),
        Err(e) => {
            error!("{:#?}", e);
            Err(LovelaceError::DatabaseError)
        }
    }
}
/// Show a list of all the tasks in a class that a student has been assigned.
Show a list of all the tasks in a class that a student has been assigned.
Show a list of all the tasks in a class that a student has been assigned .
async fn show_student_sync_tasks_summary(
    class_id: i32,
    user_id: i32,
    conn: &Database,
) -> LovelaceResult<Vec<(StudentClassSynchronousTask, ClassSynchronousTask)>> {
    use crate::schema::class_student::dsl as class_student;
    use crate::schema::class_synchronous_task::dsl as class_synchronous_task;
    use crate::schema::student_class_synchronous_task::dsl as student_class_synchronous_task;
    match conn
        .run(move |c| {
            student_class_synchronous_task::student_class_synchronous_task
                .inner_join(class_student::class_student)
                .filter(class_student::user_id.eq(user_id))
                .inner_join(class_synchronous_task::class_synchronous_task)
                .filter(class_synchronous_task::class_id.eq(class_id))
                .select((
                    crate::schema::student_class_synchronous_task::all_columns,
                    crate::schema::class_synchronous_task::all_columns,
                ))
                .load::<(StudentClassSynchronousTask, ClassSynchronousTask)>(c)
        })
        .await
    {
        Ok(tasks) => Ok(tasks),
        Err(e) => {
            error!("{:#?}", e);
            Err(LovelaceError::DatabaseError)
        }
    }
}
async fn show_student_sync_tasks_summary ( class_id : i32 , user_id : i32 , conn : & Database , ) -> LovelaceResult < Vec < ( StudentClassSynchronousTask , ClassSynchronousTask ) > > { use crate :: schema :: class_student :: dsl as class_student ; use crate :: schema :: class_synchronous_task :: dsl as class_synchronous_task ; use crate :: schema :: student_class_synchronous_task :: dsl as student_class_synchronous_task ; match conn . run ( move | c | { student_class_synchronous_task :: student_class_synchronous_task . inner_join ( class_student :: class_student ) . filter ( class_student :: user_id . eq ( user_id ) ) . inner_join ( class_synchronous_task :: class_synchronous_task ) . filter ( class_synchronous_task :: class_id . eq ( class_id ) ) . select ( ( crate :: schema :: student_class_synchronous_task :: all_columns , crate :: schema :: class_synchronous_task :: all_columns , ) ) . load :: < ( StudentClassSynchronousTask , ClassSynchronousTask ) > ( c ) } ) . await { Ok ( tasks ) => Ok ( tasks ) , Err ( e ) => { error ! ( " " e ) ; Err ( LovelaceError :: DatabaseError ) } } }
Show a list of all the tasks in a class that a student has been assigned.
Show a list of all the tasks in a class that a student has been assigned .
class_id
i32
user_id
i32
conn
&Database