admin: new route and interface to manage symlink for team association exclusing certificates

This commit is contained in:
nemunaire 2019-02-04 19:59:29 +01:00
parent 2b95995104
commit 14d31737e0
6 changed files with 132 additions and 21 deletions

View file

@ -110,6 +110,19 @@ func teamHandler(f func(fic.Team, []byte) (interface{}, error)) func(httprouter.
}
}
func teamAssocHandler(f func(fic.Team, string, []byte) (interface{}, error)) func(httprouter.Params, []byte) (interface{}, error) {
return func(ps httprouter.Params, body []byte) (interface{}, error) {
var team fic.Team
teamHandler(func (tm fic.Team, _ []byte) (interface{}, error) {
team = tm
return nil, nil
})(ps, body)
return f(team, string(ps.ByName("assoc")), body)
}
}
func themeHandler(f func(fic.Theme, []byte) (interface{}, error)) func(httprouter.Params, []byte) (interface{}, error) {
return func(ps httprouter.Params, body []byte) (interface{}, error) {
if thid, err := strconv.ParseInt(string(ps.ByName("thid")), 10, 64); err != nil {