fix(dashboard): cannot change storage policy for groups (#2577)

pull/2596/head 4.1.1
Aaron Liu 2025-06-27 12:53:07 +08:00
parent 02abeaed2e
commit d382bd8f8d
1 changed files with 2 additions and 2 deletions

View File

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