Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot fix for openshift filepath issue #698

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1170,9 +1170,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
Loading