diff --git a/src/TagzApp.Blazor.Client/Components/Pages/Moderation.razor b/src/TagzApp.Blazor.Client/Components/Pages/Moderation.razor index 5140b33d..0c0ded16 100644 --- a/src/TagzApp.Blazor.Client/Components/Pages/Moderation.razor +++ b/src/TagzApp.Blazor.Client/Components/Pages/Moderation.razor @@ -334,7 +334,7 @@ { var approvalStatus = (int)_FilterApprovalStatus; - var currentContent = (await _Connection.InvokeAsync>("GetFilteredContentByTag", _Tag, _FilteredProviders.ToArray(), approvalStatus.ToString())) + var currentContent = (await _Connection.InvokeAsync>("GetFilteredContentByTag", _Tag, _FilteredProviders.ToArray(), approvalStatus)) .ToArray(); foreach (var content in currentContent.OrderByDescending(c => c.Timestamp).ToArray()) diff --git a/src/TagzApp.Blazor/Hubs/ModerationHub.cs b/src/TagzApp.Blazor/Hubs/ModerationHub.cs index b03f5245..7525fc3a 100644 --- a/src/TagzApp.Blazor/Hubs/ModerationHub.cs +++ b/src/TagzApp.Blazor/Hubs/ModerationHub.cs @@ -111,12 +111,12 @@ public AvailableProvider[] GetAvailableProviders() } - public async Task> GetFilteredContentByTag(string tag, string[] providers, string state) + public async Task> GetFilteredContentByTag(string tag, string[] providers, int state) { - var states = string.IsNullOrEmpty(state) || state == "-1" ? + var states = state == -1 ? [ModerationState.Pending, ModerationState.Approved, ModerationState.Rejected] : - new[] { Enum.Parse(state) }; + new[] { (ModerationState)state }; var results = (await _Service.GetFilteredContentByTag(tag, providers, states)) .Select(c => ModerationContentModel.ToModerationContentModel(c.Item1, c.Item2))