diff --git a/Oqtane.Client/Modules/Admin/Profiles/Index.razor b/Oqtane.Client/Modules/Admin/Profiles/Index.razor index 0bdf8554..141730f9 100644 --- a/Oqtane.Client/Modules/Admin/Profiles/Index.razor +++ b/Oqtane.Client/Modules/Admin/Profiles/Index.razor @@ -30,9 +30,9 @@ else public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin; - protected override async Task OnInitializedAsync() + protected override async Task OnParametersSetAsync() { - _profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId); + await GetProfilesAsync(); } private async Task DeleteProfile(int profileId) @@ -41,7 +41,12 @@ else { await ProfileService.DeleteProfileAsync(profileId); await logger.LogInformation("Profile Deleted {ProfileId}", profileId); + AddModuleMessage(Localizer["Profile Deleted"], MessageType.Success); + + await GetProfilesAsync(); + + StateHasChanged(); } catch (Exception ex) { @@ -49,4 +54,9 @@ else AddModuleMessage(Localizer["Error Deleting Profile"], MessageType.Error); } } + + private async Task GetProfilesAsync() + { + _profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId); + } }