fix: new user group error in without replication

pull/2596/head
Samler 2025-06-29 12:16:02 +08:00
parent f38f32f9f5
commit bce49aa838
No known key found for this signature in database
GPG Key ID: BFDA5A582449E3B0
1 changed files with 2 additions and 2 deletions

View File

@ -85,8 +85,8 @@ func (c *groupClient) Upsert(ctx context.Context, group *ent.Group) (*ent.Group,
SetPermissions(group.Permissions).
SetSettings(group.Settings)
if group.StoragePolicyID > 0 {
stm.SetStoragePolicyID(group.StoragePolicyID)
if group.Edges.StoragePolicies != nil && group.Edges.StoragePolicies.ID > 0 {
stm.SetStoragePolicyID(group.Edges.StoragePolicies.ID)
}
return stm.Save(ctx)