Moved the applying of selected permissions to the correct place in the role dialogs
This commit was merged in pull request #7.
This commit is contained in:
@@ -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 FormHandler.SubmitAsync();
|
||||
}
|
||||
|
||||
private async Task OnSubmitAsync()
|
||||
{
|
||||
await OnSubmit.Invoke(Request);
|
||||
|
||||
await CloseAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 FormHandler.SubmitAsync();
|
||||
}
|
||||
|
||||
private async Task OnSubmitAsync()
|
||||
{
|
||||
await OnSubmit.Invoke(Request);
|
||||
|
||||
await CloseAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user