mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor(server): update asset endpoint (#3973)
* refactor(server): update asset * chore: open api
This commit is contained in:
2
mobile/openapi/doc/AssetApi.md
generated
2
mobile/openapi/doc/AssetApi.md
generated
@@ -1368,8 +1368,6 @@ Name | Type | Description | Notes
|
||||
|
||||
|
||||
|
||||
Update an asset
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
1
mobile/openapi/doc/UpdateAssetDto.md
generated
1
mobile/openapi/doc/UpdateAssetDto.md
generated
@@ -11,7 +11,6 @@ Name | Type | Description | Notes
|
||||
**description** | **String** | | [optional]
|
||||
**isArchived** | **bool** | | [optional]
|
||||
**isFavorite** | **bool** | | [optional]
|
||||
**tagIds** | **List<String>** | | [optional] [default to const []]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
7
mobile/openapi/lib/api/asset_api.dart
generated
7
mobile/openapi/lib/api/asset_api.dart
generated
@@ -1384,10 +1384,7 @@ class AssetApi {
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Update an asset
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] id (required):
|
||||
@@ -1419,8 +1416,6 @@ class AssetApi {
|
||||
);
|
||||
}
|
||||
|
||||
/// Update an asset
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] id (required):
|
||||
|
||||
15
mobile/openapi/lib/model/update_asset_dto.dart
generated
15
mobile/openapi/lib/model/update_asset_dto.dart
generated
@@ -16,7 +16,6 @@ class UpdateAssetDto {
|
||||
this.description,
|
||||
this.isArchived,
|
||||
this.isFavorite,
|
||||
this.tagIds = const [],
|
||||
});
|
||||
|
||||
///
|
||||
@@ -43,25 +42,21 @@ class UpdateAssetDto {
|
||||
///
|
||||
bool? isFavorite;
|
||||
|
||||
List<String> tagIds;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UpdateAssetDto &&
|
||||
other.description == description &&
|
||||
other.isArchived == isArchived &&
|
||||
other.isFavorite == isFavorite &&
|
||||
other.tagIds == tagIds;
|
||||
other.isFavorite == isFavorite;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(description == null ? 0 : description!.hashCode) +
|
||||
(isArchived == null ? 0 : isArchived!.hashCode) +
|
||||
(isFavorite == null ? 0 : isFavorite!.hashCode) +
|
||||
(tagIds.hashCode);
|
||||
(isFavorite == null ? 0 : isFavorite!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UpdateAssetDto[description=$description, isArchived=$isArchived, isFavorite=$isFavorite, tagIds=$tagIds]';
|
||||
String toString() => 'UpdateAssetDto[description=$description, isArchived=$isArchived, isFavorite=$isFavorite]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -80,7 +75,6 @@ class UpdateAssetDto {
|
||||
} else {
|
||||
// json[r'isFavorite'] = null;
|
||||
}
|
||||
json[r'tagIds'] = this.tagIds;
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -95,9 +89,6 @@ class UpdateAssetDto {
|
||||
description: mapValueOfType<String>(json, r'description'),
|
||||
isArchived: mapValueOfType<bool>(json, r'isArchived'),
|
||||
isFavorite: mapValueOfType<bool>(json, r'isFavorite'),
|
||||
tagIds: json[r'tagIds'] is List
|
||||
? (json[r'tagIds'] as List).cast<String>()
|
||||
: const [],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
||||
2
mobile/openapi/test/asset_api_test.dart
generated
2
mobile/openapi/test/asset_api_test.dart
generated
@@ -144,8 +144,6 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// Update an asset
|
||||
//
|
||||
//Future<AssetResponseDto> updateAsset(String id, UpdateAssetDto updateAssetDto) async
|
||||
test('test updateAsset', () async {
|
||||
// TODO
|
||||
|
||||
5
mobile/openapi/test/update_asset_dto_test.dart
generated
5
mobile/openapi/test/update_asset_dto_test.dart
generated
@@ -31,11 +31,6 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// List<String> tagIds (default value: const [])
|
||||
test('to test the property `tagIds`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user