mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor!: migrate class-validator to zod (#26597)
This commit is contained in:
+4
-5
@@ -15,23 +15,22 @@ class SyncUserMetadataV1 {
|
||||
SyncUserMetadataV1({
|
||||
required this.key,
|
||||
required this.userId,
|
||||
required this.value,
|
||||
this.value = const {},
|
||||
});
|
||||
|
||||
/// User metadata key
|
||||
UserMetadataKey key;
|
||||
|
||||
/// User ID
|
||||
String userId;
|
||||
|
||||
/// User metadata value
|
||||
Object value;
|
||||
Map<String, Object> value;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SyncUserMetadataV1 &&
|
||||
other.key == key &&
|
||||
other.userId == userId &&
|
||||
other.value == value;
|
||||
_deepEquality.equals(other.value, value);
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
@@ -62,7 +61,7 @@ class SyncUserMetadataV1 {
|
||||
return SyncUserMetadataV1(
|
||||
key: UserMetadataKey.fromJson(json[r'key'])!,
|
||||
userId: mapValueOfType<String>(json, r'userId')!,
|
||||
value: mapValueOfType<Object>(json, r'value')!,
|
||||
value: mapCastOfType<String, Object>(json, r'value')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user