Skip to content

Commit

Permalink
fixed a bug with GetFilteredContentByTag.
Browse files Browse the repository at this point in the history
  • Loading branch information
degenone committed Jun 29, 2024
1 parent 6af77db commit 3ac19de
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 results = (await _Service.GetFilteredContentByTag(tag, providers, states))
.Select(c => ModerationContentModel.ToModerationContentModel(c.Item1, c.Item2))
Expand Down

0 comments on commit 3ac19de

Please sign in to comment.