Skip to content

Commit

Permalink
Merge pull request #698 from bcgov/HotFix
Browse files Browse the repository at this point in the history
Hot fix for openshift filepath issue
  • Loading branch information
dallascrichmond authored Oct 10, 2024
2 parents 49acca2 + 184d123 commit 1304e42
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions app/Agri.CalculateService/CalculateFertigationNutrients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ private Fertilizer getFertilizer(int id){

private Fertigation GetFertigationData()
{
var filePath = "../../../Agri.Data/SeedData/FertigationData.json";
var jsonData = System.IO.File.ReadAllText(filePath);
return JsonConvert.DeserializeObject<Fertigation>(jsonData);
var jsonData = SeedDataLoader.GetSeedJsonData<Fertigation>(Constants.SeedDataFiles.Fertigation);
return jsonData;
}
}
}
1 change: 1 addition & 0 deletions app/Agri.Data/Agri.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<EmbeddedResource Include="SeedData\DepthsData.json" />
<EmbeddedResource Include="SeedData\ExternalLinksData.json" />
<EmbeddedResource Include="SeedData\JourneyData.json" />
<EmbeddedResource Include="SeedData\FertigationData.json" />
<EmbeddedResource Include="SeedData\LocationsData.json" />
<EmbeddedResource Include="SeedData\MiniAppLabelData.json" />
<EmbeddedResource Include="SeedData\NutrientIconsData.json" />
Expand Down
1 change: 1 addition & 0 deletions app/Agri.Data/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static class SeedDataFiles
public const string NutrientIcons = "Agri.Data.SeedData.NutrientIconsData.json";
public const string SubMenus = "Agri.Data.SeedData.SubMenusData.json";
public const string UserPrompts = "Agri.Data.SeedData.UserPromptsData.json";
public const string Fertigation = "Agri.Data.SeedData.FertigationData.json";
}
}
}
5 changes: 2 additions & 3 deletions app/Server/src/SERVERAPI/Controllers/NutrientsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,9 +1241,8 @@ private void FertigationUpdate(FertigationDetailsViewModel fgvm)

public Fertigation GetFertigationData()
{
var filePath = "../../../Agri.Data/SeedData/FertigationData.json";
var jsonData = System.IO.File.ReadAllText(filePath);
return JsonConvert.DeserializeObject<Fertigation>(jsonData);
var jsonData = SeedDataLoader.GetSeedJsonData<Fertigation>(Constants.SeedDataFiles.Fertigation);
return jsonData;
}

[HttpGet]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ private Task<CalcFertigationViewModel> GetFertigationAsync(string fldName)
}
public Fertigation GetFertigationData()
{
var filePath = "../../../Agri.Data/SeedData/FertigationData.json";
var jsonData = System.IO.File.ReadAllText(filePath);
return JsonConvert.DeserializeObject<Fertigation>(jsonData);
var jsonData = SeedDataLoader.GetSeedJsonData<Fertigation>(Constants.SeedDataFiles.Fertigation);
return jsonData;
}
private Fertilizer GetFertigationFertilizer(int id)
{
Expand Down

0 comments on commit 1304e42

Please sign in to comment.