fix class student user preload
This commit is contained in:
parent
83f659eed3
commit
993ce86407
|
@ -53,22 +53,22 @@ final class Clas(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private def preloadStudentUsers(students: List[lila.clas.Student.WithUser]): Funit =
|
private def preloadStudentUsers(students: List[lila.clas.Student.WithUser]): Unit =
|
||||||
env.user.lightUserApi.preloadUsers(students.map(_.user))
|
env.user.lightUserApi.preloadUsers(students.map(_.user))
|
||||||
|
|
||||||
def show(id: String) = Auth { implicit ctx => me =>
|
def show(id: String) = Auth { implicit ctx => me =>
|
||||||
WithClassAny(id, me)(
|
WithClassAny(id, me)(
|
||||||
forTeacher = WithClass(me, id) { clas =>
|
forTeacher = WithClass(me, id) { clas =>
|
||||||
env.clas.api.student.activeWithUsers(clas) map { students =>
|
env.clas.api.student.activeWithUsers(clas) map { students =>
|
||||||
preloadStudentUsers(students) inject
|
preloadStudentUsers(students)
|
||||||
views.html.clas.teacherDashboard.overview(clas, students)
|
views.html.clas.teacherDashboard.overview(clas, students)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
forStudent = (clas, students) =>
|
forStudent = (clas, students) =>
|
||||||
env.clas.api.clas.teachers(clas) map { teachers =>
|
env.clas.api.clas.teachers(clas) map { teachers =>
|
||||||
|
preloadStudentUsers(students)
|
||||||
val wall = scalatags.Text.all.raw(env.clas.markup(clas.wall))
|
val wall = scalatags.Text.all.raw(env.clas.markup(clas.wall))
|
||||||
preloadStudentUsers(students) inject
|
Ok(views.html.clas.studentDashboard(clas, wall, teachers, students))
|
||||||
Ok(views.html.clas.studentDashboard(clas, wall, teachers, students))
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue