@page "/polloverview"
@using Lieb.Data
@using System.Security.Claims
@using Lieb.Models
@using Lieb.Models.Poll
@using Lieb.Models.GuildWars2.Raid
@inject PollService PollService
@inject UserService UserService
@inject AuthenticationStateProvider AuthenticationStateProvider
Event Overview
Add Event
@foreach (var poll in _polls.OrderByDescending(p => p.PollId))
{
}
@code
{
private List _polls;
private LiebUser? _user;
protected override async Task OnInitializedAsync()
{
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
if (authState.User.Identity.IsAuthenticated)
{
ulong discordId = ulong.Parse(authState.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value);
_user = UserService.GetLiebUser(discordId);
}
_polls = PollService.GetPolls();
}
}