mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 09:12:57 +02:00
chore(mobile): properly patch openapi with custom response dto (#11753)
This commit is contained in:
parent
fdf0b16fe3
commit
5ec407b57c
12 changed files with 312 additions and 7 deletions
mobile/lib/utils
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue