|
@@ -98,12 +98,14 @@ func UpdateContactFields(ctx context.Context, tx *ent.Tx, contact_id uint64, fie
|
|
if len(field.Value) == 0 {
|
|
if len(field.Value) == 0 {
|
|
field.Value = []string{""}
|
|
field.Value = []string{""}
|
|
}
|
|
}
|
|
- _, err := tx.ContactField.UpdateOneID(f.ID).
|
|
|
|
- SetValue(field.Value).
|
|
|
|
- Save(ctx)
|
|
|
|
- if err != nil {
|
|
|
|
- return err
|
|
|
|
- }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ field.Value = []string{""}
|
|
|
|
+ }
|
|
|
|
+ _, err := tx.ContactField.UpdateOneID(f.ID).
|
|
|
|
+ SetValue(field.Value).
|
|
|
|
+ Save(ctx)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|