1
0
mirror of https://github.com/immich-app/immich.git synced 2025-07-16 07:24:40 +02:00

refactor(server): update asset endpoint (#3973)

* refactor(server): update asset

* chore: open api
This commit is contained in:
Jason Rasmussen
2023-09-04 22:25:31 -04:00
committed by GitHub
parent 26bc889f8d
commit 454737ca79
27 changed files with 237 additions and 184 deletions

View File

@ -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;