changing the Account now updates Flex roles in the UI

This commit is contained in:
t.ruspekhofer 2022-03-16 22:29:33 +01:00
parent bca069db78
commit 408f09f650
4 changed files with 50 additions and 33 deletions

View file

@ -24,7 +24,9 @@
<br> @role.Description
</td>
<td class="tdSignUp">
<SignedUpUsers _raid=@_raid _usableAccounts=@_usableAccounts _liebUserId=@_liebUserId _currentRoleId=@role.PlannedRaidRoleId></SignedUpUsers>
<CascadingValue Value="this">
<SignedUpUsers _raid=@_raid _usableAccounts=@_usableAccounts _liebUserId=@_liebUserId _currentRoleId=@role.PlannedRaidRoleId></SignedUpUsers>
</CascadingValue>
</td>
@if(_liebUserId > 0)
{
@ -60,7 +62,14 @@
{
if (_user != null)
{
_usableAccounts = _user.GuildWars2Accounts.Where(a => a.EquippedBuilds.Count > 0).ToList();
if (_raid.RaidType == RaidType.Planned)
{
_usableAccounts = _user.GuildWars2Accounts.ToList();
}
else
{
_usableAccounts = _user.GuildWars2Accounts.Where(a => a.EquippedBuilds.Count > 0).ToList();
}
_liebUserId = _user.LiebUserId;
}
}
@ -77,4 +86,12 @@
}
_raid = RaidService.GetRaid(_raid.RaidId);
}
public async Task ChangeAccount(ChangeEventArgs e)
{
int accountId = int.Parse(e.Value.ToString());
await RaidService.ChangeAccount(_raid.RaidId, _liebUserId, accountId);
_raid = RaidService.GetRaid(_raid.RaidId);
this.StateHasChanged();
}
}