fix(clients): preserve enable on portable import (#6481)

* fix(clients): preserve enable on portable import

Stop BulkCreate and orphan ImportClients from forcing enable=true, and
restate Enable=false after GORM Create (clients.enable default:true drops
the zero value). Interactive Create still defaults new clients to enabled.
Fixes #6478.

* fix(clients): respect enable=false on node mirror; omit enable defaults true

---------

Co-authored-by: mrchatam <287639636+mrchatam@users.noreply.github.com>
This commit is contained in:
mrchatam
2026-09-12 12:43:42 +03:30
committed by GitHub
parent 8082ab4d74
commit 5fbd2b490c
7 changed files with 221 additions and 14 deletions
+1 -3
View File
@@ -1324,9 +1324,7 @@ func (s *ClientService) BulkCreate(inboundSvc *InboundService, payloads []Client
if client.SubID == "" {
client.SubID = uuid.NewString()
}
if !client.Enable {
client.Enable = true
}
// Preserve enable (omit→true in UnmarshalJSON; explicit false kept) (#6478).
now := time.Now().UnixMilli()
if client.CreatedAt == 0 {
client.CreatedAt = now