admin: Return the updated team struct after password regeneration

This commit is contained in:
nemunaire 2022-05-31 14:53:53 +02:00
parent 8fd2a70894
commit 6c31820178

View File

@ -89,14 +89,14 @@ func declareTeamsPasswordRoutes(router *gin.RouterGroup) {
} else { } else {
team.Password = &passwd team.Password = &passwd
t, err := team.Update() _, err := team.Update()
if err != nil { if err != nil {
log.Println("Unable to Update Team:", err.Error()) log.Println("Unable to Update Team:", err.Error())
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Something went wrong when updating the new team password"}) c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Something went wrong when updating the new team password"})
return return
} }
c.JSON(http.StatusOK, t) c.JSON(http.StatusOK, team)
} }
}) })
} }