Skip to content

Commit

Permalink
Fix testlog link
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLarsinator committed Jun 6, 2022
1 parent 3babe58 commit d900903
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions RevolveTestDiaryXf/Models/EnvSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ namespace RevolveTestDiaryXf.Models
public class EnvSetup
{
public string OpenweatherKey { get; set; }
public string TestLogBaseUrl { get; set; }
}
}
2 changes: 1 addition & 1 deletion RevolveTestDiaryXf/RevolveTestDiaryXf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<StartupObject>RevolveTestDiaryXf.Program</StartupObject>
<PackageIcon></PackageIcon>
<PackageIconUrl />
<Version>5.0.0</Version>
<Version>5.0.1</Version>
<PackageId></PackageId>
<Authors>Revolve NTNU</Authors>
<Company>Revolve NTNU</Company>
Expand Down
4 changes: 3 additions & 1 deletion RevolveTestDiaryXf/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public bool IsDialogOpen
}

private string _dialogText;
private string _testLogBaseUrl;

public string DialogText
{
Expand All @@ -83,6 +84,7 @@ public MainWindowViewModel()
{
var envSetup = JsonSerializer.Deserialize<EnvSetup>(File.ReadAllText(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Resources/setup.env")));
_trackWeatherService = new TrackWeatherService(envSetup.OpenweatherKey);
_testLogBaseUrl = envSetup.TestLogBaseUrl;
Locations = new ObservableCollection<string>(_trackWeatherService.TownToCoordMap.Keys);
Location = Locations.FirstOrDefault();

Expand Down Expand Up @@ -211,7 +213,7 @@ public async void UploadTestDayToTestLog()
var content = new FormUrlEncodedContent(data);
try
{
var response = await client.PostAsync("http://vault.revolve.no/testlog/register/exterallog/", content);
var response = await client.PostAsync($"{_testLogBaseUrl}testlog/register/exterallog/", content);
var status = response.StatusCode;
if (status == HttpStatusCode.Created)
{
Expand Down

0 comments on commit d900903

Please sign in to comment.