algunos refactors y arregle el tema de que no se eliminaban los

subgrupos
This commit is contained in:
fede committed 2026-06-18 02:25:23 -03:00
1 parent ab88be0ba5
commit df2412f29a
25 files changed
+415 -261

No files matched your search

+18 -1
View File
@@ -1,9 +1,26 @@
package repuestos
import (
"net/http"
"repuestera_back/models"
"github.com/gin-gonic/gin"
r "repuestera_back/repositorios"
)
func CrearRepuesto(c *gin.Context){
func CrearRepuesto(c *gin.Context){
var repuesto models.Repuesto
if err := c.ShouldBindJSON(&repuesto); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
if err := r.ObtenerRepositorios().Repuesto.Crear(&repuesto); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusCreated, repuesto)
}