From 0ceb773865815816eedf7d522c98d92062484424 Mon Sep 17 00:00:00 2001 From: Fynn Petersen-Frey <10599762+fyfrey@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:59:30 +0200 Subject: [PATCH] fix(mobile): profileChangedAt compatiblity with old servers (#12774) * fix(mobile): profileChangedAt compatiblity with old servers * chore: add breaks --------- Co-authored-by: Jason Rasmussen --- mobile/lib/utils/openapi_patching.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mobile/lib/utils/openapi_patching.dart b/mobile/lib/utils/openapi_patching.dart index 349b2322af..c473fbb833 100644 --- a/mobile/lib/utils/openapi_patching.dart +++ b/mobile/lib/utils/openapi_patching.dart @@ -12,6 +12,16 @@ dynamic upgradeDto(dynamic value, String targetType) { addDefault(value, 'tags', TagsResponse().toJson()); } break; + case 'UserResponseDto': + if (value is Map) { + addDefault(value, 'profileChangedAt', DateTime.now().toIso8601String()); + } + break; + case 'UserAdminResponseDto': + if (value is Map) { + addDefault(value, 'profileChangedAt', DateTime.now().toIso8601String()); + } + break; } }