Files

19 lines
358 B
Go

package repuestos
import (
"net/http"
"github.com/gin-gonic/gin"
r "repuestera_back/repositorios"
)
func ObtenerRepuestos(c *gin.Context) {
repuestos, err := r.ObtenerRepositorios(c).Repuesto.ObtenerTodosConMarca()
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, repuestos)
}