Skip to content

Commit

Permalink
coach reviews WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Aug 31, 2016
1 parent 0c2e9c7 commit f4b39b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/Coach.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object Coach extends LilaController {
c.coach.profile.studyIds.map(_.value)
} flatMap Env.study.pager.withChaptersAndLiking(ctx.me) flatMap { studies =>
api.reviews.approvedByCoach(c.coach) map { reviews =>
Ok(html.coach.show(c, studies, reviews))
Ok(html.coach.show(c, reviews, studies))
}
}
else notFound
Expand Down
8 changes: 4 additions & 4 deletions modules/coach/src/main/CoachApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ final class CoachApi(

object reviews {

def approvedByCoach(c: Coach): Fu[List[CoachReview]] =
def approvedByCoach(c: Coach): Fu[CoachReview.Reviews] =
reviewColl.find(
$doc("coachId" -> c.id.value, "approved" -> true)
).sort($sort desc "createdAt").list[CoachReview](100)
).sort($sort desc "createdAt").list[CoachReview](100) map CoachReview.Reviews.apply

def allByCoach(c: Coach): Fu[List[CoachReview]] =
def allByCoach(c: Coach): Fu[CoachReview.Reviews] =
reviewColl.find(
$doc("coachId" -> c.id.value)
).sort($sort desc "createdAt").list[CoachReview](100)
).sort($sort desc "createdAt").list[CoachReview](100) map CoachReview.Reviews.apply
}
}

0 comments on commit f4b39b0

Please sign in to comment.