Show all albums an asset appears in on the asset viewer page (#575)

* Add route to query albums for a specific asset

* Update API and add to detail-panel

* Fix tests

* Refactor API endpoint

* Added alt attribute to img tag

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Matthias Rupp 2022-09-05 15:50:20 +02:00 committed by GitHub
parent 6976a7241e
commit caa7b07398
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 114 additions and 17 deletions

View file

@ -259,7 +259,10 @@ class AlbumApi {
/// Parameters:
///
/// * [bool] shared:
Future<Response> getAllAlbumsWithHttpInfo({ bool? shared, }) async {
///
/// * [String] assetId:
/// Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
Future<Response> getAllAlbumsWithHttpInfo({ bool? shared, String? assetId, }) async {
// ignore: prefer_const_declarations
final path = r'/album';
@ -273,6 +276,9 @@ class AlbumApi {
if (shared != null) {
queryParams.addAll(_queryParams('', 'shared', shared));
}
if (assetId != null) {
queryParams.addAll(_queryParams('', 'assetId', assetId));
}
const contentTypes = <String>[];
@ -291,8 +297,11 @@ class AlbumApi {
/// Parameters:
///
/// * [bool] shared:
Future<List<AlbumResponseDto>?> getAllAlbums({ bool? shared, }) async {
final response = await getAllAlbumsWithHttpInfo( shared: shared, );
///
/// * [String] assetId:
/// Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
Future<List<AlbumResponseDto>?> getAllAlbums({ bool? shared, String? assetId, }) async {
final response = await getAllAlbumsWithHttpInfo( shared: shared, assetId: assetId, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}