Files
Media.JoshHeaps.Net/Media.JoshHeaps.Net/Pages/NetworkGraph.cshtml.cs
T
2026-01-02 17:13:39 -07:00

26 lines
738 B
C#

using Media.JoshHeaps.Net.Models;
using Media.JoshHeaps.Net.Services;
using Microsoft.AspNetCore.Mvc;
namespace Media.JoshHeaps.Net.Pages
{
public class NetworkGraphModel(GraphService graphService) : AuthenticatedPageModel
{
private readonly GraphService _graphService = graphService;
public List<GraphWithCounts> Graphs { get; set; } = [];
public long? SelectedGraphId { get; set; }
public async Task<IActionResult> OnGetAsync([FromQuery] long? graphId = null)
{
RequireAuthentication();
LoadUserSession();
Graphs = await _graphService.GetUserGraphsAsync(UserId);
SelectedGraphId = graphId;
return Page();
}
}
}