Skip to content

Commit

Permalink
Merge pull request #454 from degenone/bug_GetFilteredContentByTag
Browse files Browse the repository at this point in the history
  • Loading branch information
csharpfritz authored Jul 2, 2024
2 parents 2d67e85 + 3ac19de commit 234eafb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
{

var approvalStatus = (int)_FilterApprovalStatus;
var currentContent = (await _Connection.InvokeAsync<IEnumerable<ModerationContentModel>>("GetFilteredContentByTag", _Tag, _FilteredProviders.ToArray(), approvalStatus.ToString()))
var currentContent = (await _Connection.InvokeAsync<IEnumerable<ModerationContentModel>>("GetFilteredContentByTag", _Tag, _FilteredProviders.ToArray(), approvalStatus))
.ToArray();

foreach (var content in currentContent.OrderByDescending(c => c.Timestamp).ToArray())
Expand Down
6 changes: 3 additions & 3 deletions src/TagzApp.Blazor/Hubs/ModerationHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ public AvailableProvider[] GetAvailableProviders()

}

public async Task<IEnumerable<ModerationContentModel>> GetFilteredContentByTag(string tag, string[] providers, string state)
public async Task<IEnumerable<ModerationContentModel>> 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<ModerationState>(state) };
new[] { (ModerationState)state };

var hiddenUsers = (await _Repository.GetBlockedUsers())
.Where(b => b.Capabilities == BlockedUserCapabilities.Hidden)
Expand Down

0 comments on commit 234eafb

Please sign in to comment.