Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug with GetFilteredContentByTag #454

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading