fix empty result of rating history API endpoint
This commit is contained in:
parent
08004bbb8b
commit
bea1b52788
|
@ -171,7 +171,10 @@ final class User(
|
|||
|
||||
def ratingHistory(username: String) = OpenBody { implicit ctx =>
|
||||
EnabledUser(username) { u =>
|
||||
env.history.ratingChartApi(u) map { Ok(_) as JSON }
|
||||
env.history
|
||||
.ratingChartApi(u)
|
||||
.dmap(_ | "[]") // send an empty JSON array if no history JSON is available
|
||||
.dmap { Ok(_) as JSON }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue