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
Showing only changes of commit 76a8a72e83 - Show all commits

View File

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

View File

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