admin: add history route in API
This commit is contained in:
parent
c402d28056
commit
0696da2fdf
2 changed files with 54 additions and 0 deletions
|
@ -55,6 +55,14 @@ func init() {
|
|||
return fic.GetTeamsStats(nil)
|
||||
}
|
||||
})))
|
||||
router.GET("/api/teams/:tid/history.json", apiHandler(teamPublicHandler(
|
||||
func(team *fic.Team, _ []byte) (interface{}, error) {
|
||||
if team != nil {
|
||||
return team.GetHistory()
|
||||
} else {
|
||||
return fic.GetTeamsStats(nil)
|
||||
}
|
||||
})))
|
||||
router.GET("/api/teams/:tid/tries", apiHandler(teamPublicHandler(
|
||||
func(team *fic.Team, _ []byte) (interface{}, error) {
|
||||
return fic.GetTries(team, nil) })))
|
||||
|
|
Reference in a new issue