fix class student user preload

pull/6464/head
Thibault Duplessis 2020-04-24 12:01:35 -06:00
parent 83f659eed3
commit 993ce86407
1 changed files with 5 additions and 5 deletions

View File

@ -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))
def show(id: String) = Auth { implicit ctx => me =>
WithClassAny(id, me)(
forTeacher = WithClass(me, id) { clas =>
env.clas.api.student.activeWithUsers(clas) map { students =>
preloadStudentUsers(students) inject
views.html.clas.teacherDashboard.overview(clas, students)
preloadStudentUsers(students)
views.html.clas.teacherDashboard.overview(clas, students)
}
},
forStudent = (clas, students) =>
env.clas.api.clas.teachers(clas) map { teachers =>
preloadStudentUsers(students)
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))
}
)
}