From d382bd8f8d799dfca3136ef42075ef25c32259b4 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Fri, 27 Jun 2025 12:53:07 +0800 Subject: [PATCH] fix(dashboard): cannot change storage policy for groups (#2577) --- inventory/group.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inventory/group.go b/inventory/group.go index 3ecd697..70089ed 100644 --- a/inventory/group.go +++ b/inventory/group.go @@ -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)