Compare commits

..

No commits in common. "1d7139fc1ade06f6f477a7e785ece452844aea7a" and "cd98df5a2365dc242308509166904a803ccef123" have entirely different histories.

3 changed files with 10 additions and 18 deletions

View File

@ -316,18 +316,13 @@ public class UserService : IUserService
// Update default club if specified
if (dto.DefaultClubId.HasValue)
{
// First: clear all defaults (to avoid unique index violation)
foreach (var m in profile.Clubs)
{
m.IsDefault = false;
}
await _appDb.SaveChangesAsync(ct);
var memberships = await _appDb.UserProfileClubs
.Where(upc => upc.UserProfileId == profile.Id)
.ToListAsync(ct);
// Then: set the new default
var newDefault = profile.Clubs.FirstOrDefault(m => m.ClubId == dto.DefaultClubId.Value);
if (newDefault != null)
foreach (var m in memberships)
{
newDefault.IsDefault = true;
m.IsDefault = m.ClubId == dto.DefaultClubId.Value;
}
}

View File

@ -39,7 +39,7 @@
}
else
{
<MudText Typo="Typo.subtitle2" Class="mb-2">Teilnehmer auswählen</MudText>
<MudText Typo="Typo.subtitle2" Class="mb-2">Teilnehmer vorauswählen</MudText>
<MudText Typo="Typo.caption" Color="Color.Secondary" Class="mb-2">
Mitglieder sind automatisch vorausgewählt. Du kannst Teilnehmer später noch ändern.
</MudText>

View File

@ -50,13 +50,10 @@
Filtern
</MudButton>
<MudSpacer />
@if (AuthState.Value.IsClubEditor || AuthState.Value.IsClubTreasurer || AuthState.Value.IsClubAdmin || AuthState.Value.IsSuperAdmin)
{
<MudButton Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.Add"
OnClick="OpenCreateDialog">
Neuer Spieltag
</MudButton>
}
<MudButton Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.Add"
OnClick="OpenCreateDialog">
Neuer Spieltag
</MudButton>
</ToolBarContent>
<HeaderContent>
<MudTh><MudTableSortLabel SortBy="new Func<DaySummaryDto, object>(x => x.PostDate)">Datum</MudTableSortLabel></MudTh>