chore(mobile): properly patch openapi with custom response dto ()

This commit is contained in:
Alex 2024-08-13 14:39:25 -05:00 committed by GitHub
parent fdf0b16fe3
commit 5ec407b57c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 312 additions and 7 deletions
mobile/lib/utils

View 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();
}
}
}
}