feat(ui): unassigned album selector in PersonForm, Add Albums button in CosplayerDetail

This commit is contained in:
2026-07-09 15:07:19 +02:00
parent 9aead51481
commit cc611828b9
6 changed files with 172 additions and 3 deletions

View File

@@ -46,6 +46,30 @@ public sealed class AlbumService(
return null;
}
/// <summary>
/// Gets all albums that have no person assigned.
/// </summary>
/// <returns>A list of unassigned album previews, or null if the request failed.</returns>
public async Task<List<AlbumPreviewDto>?> GetUnassignedAsync() {
var response = await SendWithRefreshAsync(() => Client.GetAsync("/api/album/unassigned"));
if (response.IsSuccessStatusCode)
return await response.Content.ReadFromJsonAsync<List<AlbumPreviewDto>>();
return null;
}
/// <summary>
/// Assigns a person to an album.
/// </summary>
/// <param name="albumId">The album ID.</param>
/// <param name="personId">The person ID to assign.</param>
public async Task AssignPersonAsync(Guid albumId, Guid personId) {
var dto = new AlbumUpdateDto { Person = personId };
var response = await Client.PostAsJsonAsync($"/api/album/{albumId}", dto);
response.EnsureSuccessStatusCode();
}
/// <summary>
/// Creates a new album.
/// </summary>