fix(ui): schema-library delete-audit name + busy guard + edit-row guard + sanitized create-race test (#260)
This commit is contained in:
@@ -2323,8 +2323,13 @@ public class ManagementActor : ReceiveActor
|
||||
private static async Task<object?> HandleDeleteSharedSchema(IServiceProvider sp, DeleteSharedSchemaCommand cmd, string user)
|
||||
{
|
||||
var repo = sp.GetRequiredService<ISharedSchemaRepository>();
|
||||
// Pre-fetch the human-readable name before the row is gone so the audit
|
||||
// EntityName records "Address" rather than the numeric id — mirroring the
|
||||
// Site delete handler. Falls back to the id when the row is already absent.
|
||||
var schema = await repo.GetByIdAsync(cmd.SharedSchemaId);
|
||||
await repo.DeleteAsync(cmd.SharedSchemaId);
|
||||
await AuditAsync(sp, user, "Delete", "SharedSchema", cmd.SharedSchemaId.ToString(), cmd.SharedSchemaId.ToString(), null);
|
||||
await AuditAsync(sp, user, "Delete", "SharedSchema", cmd.SharedSchemaId.ToString(),
|
||||
schema?.Name ?? cmd.SharedSchemaId.ToString(), null);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user