package grupo import ( "net/http" r "repuestera_back/repositorios" "strconv" "github.com/gin-gonic/gin" ) func QuitarSubGrupo(c *gin.Context) { var req struct { ChildGroupID uint `json:"child_group_id"` } if err := c.ShouldBindJSON(&req); err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return } padreID, err := strconv.ParseUint(c.Param("id"), 10, 64) if err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"}) return } if err := r.ObtenerRepositorios(c).Grupo.QuitarSubGrupo(uint(padreID), req.ChildGroupID); err != nil { c.JSON(http.StatusNotFound, gin.H{"error": err.Error()}) return } c.JSON(http.StatusOK, gin.H{"message": "Subgrupo quitado"}) }