using System; using Expedience.Infrastructure.Models; using Expedience.Web.Services; using Microsoft.AspNetCore.Mvc.RazorPages; namespace Expedience.Web.Pages { public class IndexModel : PageModel { private readonly IApiService _apiService; public List? DutyCompletionRecords { get; private set; } public List? DeepDungeonRecords { get; private set; } public IndexModel(IApiService apiService) { _apiService = apiService; } public async Task OnGet(string? expac, CancellationToken cancellationToken) { if (expac == null) expac = "DT"; if (expac == "DeepDungeons") { DutyCompletionRecords = null; DeepDungeonRecords = await _apiService.GetDeepDungeonRecordsAsync(cancellationToken); } else { DutyCompletionRecords = await _apiService.GetDutyCompletionRecordsAsync(expac, cancellationToken); DeepDungeonRecords = null; } } } }