Include AliasId in service API calls ( this is not needed for interacting with the MasterDB repository however it is needed for tenant-based logging )

This commit is contained in:
Shaun Walker
2020-05-12 20:31:31 -04:00
parent 3efd39c74f
commit 560c995564
6 changed files with 43 additions and 14 deletions

View File

@ -3,15 +3,21 @@ using System.Threading.Tasks;
using System.Net.Http;
using System.Linq;
using System.Collections.Generic;
using Oqtane.Shared;
namespace Oqtane.Services
{
public class JobService : ServiceBase, IJobService
{
public JobService(HttpClient http) : base(http) { }
private readonly SiteState _siteState;
private string Apiurl => CreateApiUrl("Job");
public JobService(HttpClient http, SiteState siteState) : base(http)
{
_siteState = siteState;
}
private string Apiurl => CreateApiUrl(_siteState.Alias, "Job");
public async Task<List<Job>> GetJobsAsync()
{
List<Job> jobs = await GetJsonAsync<List<Job>>(Apiurl);