add /api/user/:user/perf/:perf endpoint

pull/9317/head
Thibault Duplessis 2021-06-30 08:53:17 +02:00
parent 0edbe22e7f
commit 05549a2920
2 changed files with 8 additions and 0 deletions

View File

@ -395,6 +395,13 @@ final class Api(
}
}
def perfStat(username: String, perfKey: String) = ApiRequest { req =>
implicit val lang = reqLang(req)
env.perfStat.api.data(username, perfKey, none) map {
_.fold[ApiResult](NoData) { data => Data(env.perfStat.jsonView(data)) }
}
}
def CookieBasedApiRequest(js: Context => Fu[ApiResult]) =
Open { ctx =>
js(ctx) map toHttp

View File

@ -624,6 +624,7 @@ GET /api/user/:name/followers controllers.Relation.apiFollowers(name: S
POST /api/user/:name/note controllers.User.apiWriteNote(name: String)
GET /api/user/:name/rating-history controllers.User.ratingHistory(name: String)
GET /api/user/:name/current-game controllers.User.tvExport(name: String)
GET /api/user/:name/perf/:perfKey controllers.Api.perfStat(name: String, perfKey: String)
GET /api/game/:id controllers.Api.game(id: String)
GET /api/tournament controllers.Api.currentTournaments
GET /api/tournament/:id controllers.Api.tournament(id: String)