You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-07-16 07:24:40 +02:00
chore(mobile): properly patch openapi with custom response dto (#11753)
This commit is contained in:
12
mobile/lib/utils/openapi_patching.dart
Normal file
12
mobile/lib/utils/openapi_patching.dart
Normal file
@ -0,0 +1,12 @@
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
dynamic upgradeDto(dynamic value, String targetType) {
|
||||
switch (targetType) {
|
||||
case 'UserPreferencesResponseDto':
|
||||
if (value is Map) {
|
||||
if (value['rating'] == null) {
|
||||
value['rating'] = RatingResponse().toJson();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user