From c5e3c9b35ee04d41ff6f5de5d899582a21da1846 Mon Sep 17 00:00:00 2001 From: hishamco Date: Sat, 13 Mar 2021 13:02:40 +0300 Subject: [PATCH] Delete profile should refresh profiles list --- Oqtane.Client/Modules/Admin/Profiles/Index.razor | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Oqtane.Client/Modules/Admin/Profiles/Index.razor b/Oqtane.Client/Modules/Admin/Profiles/Index.razor index 0bdf8554..f90f367e 100644 --- a/Oqtane.Client/Modules/Admin/Profiles/Index.razor +++ b/Oqtane.Client/Modules/Admin/Profiles/Index.razor @@ -32,7 +32,7 @@ else protected override async Task OnInitializedAsync() { - _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,7 @@ else AddModuleMessage(Localizer["Error Deleting Profile"], MessageType.Error); } } + + private async Task GetProfilesAsync() + => _profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId); }