fix(ui): MV-14 review — surface SetAttributeOverride failures in InstanceConfigure save loop (no false success toast)
This commit is contained in:
+8
-1
@@ -973,13 +973,20 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var failures = new List<string>();
|
||||
foreach (var (attrName, value) in toSave)
|
||||
{
|
||||
var result = await InstanceService.SetAttributeOverrideAsync(Id, attrName, value, user);
|
||||
if (result.IsSuccess)
|
||||
_existingOverrides[attrName] = result.Value!;
|
||||
else
|
||||
failures.Add($"{attrName}: {result.Error}");
|
||||
}
|
||||
_toast.ShowSuccess($"Saved {toSave.Count} override(s).");
|
||||
if (failures.Count > 0)
|
||||
_toast.ShowError($"Failed to save {failures.Count} override(s): {string.Join("; ", failures)}");
|
||||
var savedCount = toSave.Count - failures.Count;
|
||||
if (savedCount > 0)
|
||||
_toast.ShowSuccess($"Saved {savedCount} override(s).");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user