refactoring the code.
This commit is contained in:
23
Oqtane.Client/Services/SearchResultsService.cs
Normal file
23
Oqtane.Client/Services/SearchResultsService.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Oqtane.Documentation;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Modules;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||
public class SearchResultsService : ServiceBase, ISearchResultsService, IClientService
|
||||
{
|
||||
public SearchResultsService(HttpClient http, SiteState siteState) : base(http, siteState) { }
|
||||
|
||||
private string ApiUrl => CreateApiUrl("SearchResults");
|
||||
|
||||
public async Task<SearchResults> SearchAsync(int moduleId, SearchQuery searchQuery)
|
||||
{
|
||||
return await PostJsonAsync<SearchQuery, SearchResults>(CreateAuthorizationPolicyUrl(ApiUrl, EntityNames.Module, moduleId), searchQuery);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user