fix: usar Updates(map) en lugar de Updates(struct) para evitar error id en PostgreSQL
This commit is contained in:
@@ -57,7 +57,15 @@ func CreateServicio(s Servicio) error {
|
||||
}
|
||||
|
||||
func UpdateServicio(s Servicio) error {
|
||||
return app.Http.Database.DB.Model(&s).Updates(s).Error
|
||||
return app.Http.Database.DB.Model(&Servicio{}).Where("id = ?", s.ID).Updates(map[string]interface{}{
|
||||
"nombre": s.Nombre,
|
||||
"descripcion": s.Descripcion,
|
||||
"precio": s.Precio,
|
||||
"moneda": s.Moneda,
|
||||
"tipo": s.Tipo,
|
||||
"periodicidad": s.Periodicidad,
|
||||
"activo": s.Activo,
|
||||
}).Error
|
||||
}
|
||||
|
||||
func DeleteServicio(id uint) error {
|
||||
|
||||
Reference in New Issue
Block a user