admin: When deleting team, also delete associations

This commit is contained in:
nemunaire 2022-02-03 10:16:52 +01:00
parent 2ca2018485
commit 02bd5f316a
3 changed files with 28 additions and 10 deletions

View file

@ -96,10 +96,7 @@ func init() {
})))
router.DELETE("/api/teams/:tid/associations/:assoc", apiHandler(teamAssocHandler(
func(team *fic.Team, assoc string, _ []byte) (interface{}, error) {
if err := os.Remove(path.Join(TeamsDir, assoc)); err != nil {
return nil, err
}
return "null", nil
return "null", pki.DeleteTeamAssociation(TeamsDir, assoc)
})))
router.GET("/api/certs/", apiHandler(getCertificates))