Skip to content

Commit

Permalink
Change path to deal with permissions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Layoric committed Apr 10, 2024
1 parent d3d7d89 commit a1dc171
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion MyApp.ServiceInterface/LeaderboardServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task<object> Any(CalculateLeaderBoard request)

// Serialize the response to a leaderboard json file
var json = leaderBoard.ToJson();
await File.WriteAllTextAsync("leaderboard.json", json);
await File.WriteAllTextAsync("App_Data/leaderboard.json", json);

return leaderBoard;
}
Expand Down
4 changes: 2 additions & 2 deletions MyApp/Components/Pages/Leaderboard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
{
await base.OnInitializedAsync();
// Only generate if missing, otherwise background task will update it.
if (!File.Exists("leaderboard.json"))
if (!File.Exists("App_Data/leaderboard.json"))
await ApiAsync(new CalculateLeaderBoard());
var jsonData = File.ReadAllText("leaderboard.json");
var jsonData = File.ReadAllText("App_Data/leaderboard.json");
data = jsonData.FromJson<CalculateLeaderboardResponse>();
}

Expand Down

0 comments on commit a1dc171

Please sign in to comment.