feat(ui): unassigned album selector in PersonForm, Add Albums button in CosplayerDetail
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user