package grupo import ( "net/http" dto_directors "repuestera_back/dto/Builders/Directors" r "repuestera_back/repositorios" "github.com/gin-gonic/gin" ) func ObtenerGrupos(c *gin.Context) { grupos, err := r.ObtenerRepositorios(c).Grupo.ObtenerTodosConRelaciones() if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return } respuesta, err := dto_directors.NewGrupoDirector().Listar(grupos) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return } c.JSON(http.StatusOK, respuesta) }