Merge branch 'main' into feat/selection-bar-tags-untag

pull/24538/head
Pacien B 2025-12-12 16:30:54 +01:00 committed by GitHub
commit 89c1ed8093
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -17,8 +17,10 @@ class PersonApiRepository extends ApiRepository {
}
Future<PersonDto> update(String id, {String? name, DateTime? birthday}) async {
final dto = await checkNull(_api.updatePerson(id, PersonUpdateDto(name: name, birthDate: birthday)));
return _toPerson(dto);
final birthdayUtc = birthday == null ? null : DateTime.utc(birthday.year, birthday.month, birthday.day);
final dto = PersonUpdateDto(name: name, birthDate: birthdayUtc);
final response = await checkNull(_api.updatePerson(id, dto));
return _toPerson(response);
}
static PersonDto _toPerson(PersonResponseDto dto) => PersonDto(