New setting delegated_qa to store QA managers
This commit is contained in:
parent
e000778696
commit
d2f409db7a
11 changed files with 148 additions and 20 deletions
|
@ -37,6 +37,7 @@ func declareTeamsRoutes(router *gin.RouterGroup) {
|
|||
|
||||
c.JSON(http.StatusOK, teams)
|
||||
})
|
||||
router.GET("/teams-associations.json", allAssociations)
|
||||
router.GET("/teams-binding", bindingTeams)
|
||||
router.GET("/teams-nginx", nginxGenTeams)
|
||||
router.POST("/disableinactiveteams", disableInactiveTeams)
|
||||
|
@ -282,6 +283,31 @@ func bindingTeams(c *gin.Context) {
|
|||
c.String(http.StatusOK, ret)
|
||||
}
|
||||
|
||||
func allAssociations(c *gin.Context) {
|
||||
teams, err := fic.GetTeams()
|
||||
if err != nil {
|
||||
log.Println("Unable to GetTeams:", err.Error())
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
var ret []string
|
||||
|
||||
for _, team := range teams {
|
||||
assocs, err := pki.GetTeamAssociations(TeamsDir, team.Id)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
for _, a := range assocs {
|
||||
ret = append(ret, a)
|
||||
}
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, ret)
|
||||
}
|
||||
|
||||
func createTeam(c *gin.Context) {
|
||||
var ut fic.Team
|
||||
err := c.ShouldBindJSON(&ut)
|
||||
|
|
Reference in a new issue