mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(server) Extend PUT /album/:id/assets endpoint (#857)
* Add new query parameter to API endpoint that allows adding assets to albums which potentially contain assets that are already part of this album. * Change API endpoint * Generate new APIs * Fixed test Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -53,7 +53,7 @@ class AlbumApi {
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [AddAssetsDto] addAssetsDto (required):
|
||||
Future<AlbumResponseDto?> addAssetsToAlbum(String albumId, AddAssetsDto addAssetsDto,) async {
|
||||
Future<AddAssetsResponseDto?> addAssetsToAlbum(String albumId, AddAssetsDto addAssetsDto,) async {
|
||||
final response = await addAssetsToAlbumWithHttpInfo(albumId, addAssetsDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
@@ -62,7 +62,7 @@ class AlbumApi {
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AddAssetsResponseDto',) as AddAssetsResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user