fix(auth): C3 review — surface seam not-found (no silent success), partial-reconcile-failure guidance, create validation order, concurrent-edit reconciler test
This commit is contained in:
@@ -146,7 +146,13 @@
|
||||
{
|
||||
var newEnabled = !key.Enabled;
|
||||
// The seam persists; there is no separate SaveChangesAsync.
|
||||
await ApiKeyAdmin.SetEnabledAsync(key.KeyId, newEnabled);
|
||||
var ok = await ApiKeyAdmin.SetEnabledAsync(key.KeyId, newEnabled);
|
||||
if (!ok)
|
||||
{
|
||||
_toast.ShowError($"API key '{key.Name}' was not found — it may have been removed. Refreshing.");
|
||||
await LoadDataAsync();
|
||||
return;
|
||||
}
|
||||
_toast.ShowSuccess($"API key '{key.Name}' {(newEnabled ? "enabled" : "disabled")}.");
|
||||
await LoadDataAsync();
|
||||
}
|
||||
@@ -166,7 +172,13 @@
|
||||
|
||||
try
|
||||
{
|
||||
await ApiKeyAdmin.DeleteAsync(key.KeyId);
|
||||
var ok = await ApiKeyAdmin.DeleteAsync(key.KeyId);
|
||||
if (!ok)
|
||||
{
|
||||
_toast.ShowError($"API key '{key.Name}' was not found — it may have been removed. Refreshing.");
|
||||
await LoadDataAsync();
|
||||
return;
|
||||
}
|
||||
_toast.ShowSuccess($"API key '{key.Name}' deleted.");
|
||||
await LoadDataAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user