Skip to content

Commit

Permalink
Checking in to switch branches (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
micowan authored Sep 17, 2024
1 parent ce04079 commit 9704fb8
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
[ExcludeFromCodeCoverage]
public partial class DetectionAPIBroker : IDetectionAPIBroker
{
// TODO: Move to an appsettings
private readonly string _detectionApiUrn = "https://localhost:5001/api";

private readonly IHttpService _apiClient;
private readonly AppSettings _appSettings;

public DetectionAPIBroker(IHttpService apiClient)
public DetectionAPIBroker(IHttpService apiClient, AppSettings appSettings)
{
_apiClient = apiClient;
_appSettings = appSettings;
}

private async ValueTask<T> GetAsync<T>(string relativeUrl) =>
Expand All @@ -27,9 +26,11 @@ private async ValueTask<T> DeleteAsync<T>(string relativeUrl) =>

private string createFullUrl(string relativeUrl)
{
return _detectionApiUrn.EndsWith("/") ?
$"{_detectionApiUrn}{relativeUrl}" :
$"{_detectionApiUrn}/{relativeUrl}";
string detectionApiUrn = _appSettings.APIUrl;

return detectionApiUrn.EndsWith("/") ?
$"{detectionApiUrn}{relativeUrl}" :
$"{detectionApiUrn}/{relativeUrl}";
}
}
}

0 comments on commit 9704fb8

Please sign in to comment.