Moved the applying of selected permissions to the correct place in the role dialogs #7

Merged
ChiaraBm merged 1 commits from feat/CleanupRoles into v2.1 2026-01-19 10:07:04 +00:00
2 changed files with 14 additions and 8 deletions

View File

@@ -18,7 +18,7 @@
</DialogDescription>
</DialogHeader>
<FormHandler @ref="FormHandler" Model="Request" OnValidSubmit="SubmitAsync">
<FormHandler @ref="FormHandler" Model="Request" OnValidSubmit="OnSubmitAsync">
<div class="flex flex-col gap-6">
<FormValidationSummary/>
@@ -51,7 +51,7 @@
</FormHandler>
<DialogFooter ClassName="justify-end gap-x-1">
<WButtom OnClick="_ => FormHandler.SubmitAsync()">Save changes</WButtom>
<WButtom OnClick="SubmitAsync">Save changes</WButtom>
</DialogFooter>
@code
@@ -75,9 +75,12 @@
private async Task SubmitAsync()
{
Request.Permissions = Permissions.ToArray();
await OnSubmit.Invoke(Request);
await FormHandler.SubmitAsync();
}
private async Task OnSubmitAsync()
{
await OnSubmit.Invoke(Request);
await CloseAsync();
}
}

View File

@@ -20,7 +20,7 @@
</DialogDescription>
</DialogHeader>
<FormHandler @ref="FormHandler" Model="Request" OnValidSubmit="SubmitAsync">
<FormHandler @ref="FormHandler" Model="Request" OnValidSubmit="OnSubmitAsync">
<div class="flex flex-col gap-6">
<FormValidationSummary/>
@@ -53,7 +53,7 @@
</FormHandler>
<DialogFooter ClassName="justify-end gap-x-1">
<WButtom OnClick="_ => FormHandler.SubmitAsync()">Save changes</WButtom>
<WButtom OnClick="SubmitAsync">Save changes</WButtom>
</DialogFooter>
@code
@@ -74,9 +74,12 @@
private async Task SubmitAsync()
{
Request.Permissions = Permissions.ToArray();
await OnSubmit.Invoke(Request);
await FormHandler.SubmitAsync();
}
private async Task OnSubmitAsync()
{
await OnSubmit.Invoke(Request);
await CloseAsync();
}
}