Skip to content

Commit

Permalink
:3
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Aug 29, 2024
1 parent 80f523d commit 5cea37e
Show file tree
Hide file tree
Showing 21 changed files with 2,064 additions and 69 deletions.
13 changes: 11 additions & 2 deletions ReplayBrowser/Controllers/ReplayController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using ReplayBrowser.Data;
using ReplayBrowser.Data.Models;
using ReplayBrowser.Helpers;
Expand Down Expand Up @@ -33,13 +34,21 @@ public ReplayController(ReplayDbContext dbContext, AccountService accountService
public async Task<IActionResult> GetReplay(int replayId)
{
var authState = new AuthenticationState(HttpContext.User);
var replay = await _replayHelper.GetReplay(replayId, authState);
var replay = await _replayHelper.GetFullReplay(replayId, authState);
if (replay == null)
{
return NotFound();
}

return Ok(replay);
var settings = new JsonSerializerSettings
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
Formatting = Formatting.Indented,
TypeNameHandling = TypeNameHandling.None,
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple
};

return Ok(JsonConvert.SerializeObject(replay, settings));
}

/// <summary>
Expand Down
Loading

0 comments on commit 5cea37e

Please sign in to comment.