fix: usar Updates(map) en lugar de Updates(struct) para evitar error id en PostgreSQL
This commit is contained in:
+10
-1
@@ -59,7 +59,16 @@ func CreateCliente(c Cliente) error {
|
||||
}
|
||||
|
||||
func UpdateCliente(c Cliente) error {
|
||||
return app.Http.Database.DB.Model(&c).Updates(c).Error
|
||||
return app.Http.Database.DB.Model(&Cliente{}).Where("id = ?", c.ID).Updates(map[string]interface{}{
|
||||
"nombre": c.Nombre,
|
||||
"empresa": c.Empresa,
|
||||
"email": c.Email,
|
||||
"email_cc": c.EmailCC,
|
||||
"telefono": c.Telefono,
|
||||
"documento": c.Documento,
|
||||
"notas": c.Notas,
|
||||
"activo": c.Activo,
|
||||
}).Error
|
||||
}
|
||||
|
||||
func DeleteCliente(id uint) error {
|
||||
|
||||
Reference in New Issue
Block a user