refactor(server): use date type for entities (#2602)

This commit is contained in:
Michel Heusschen
2023-05-30 15:15:56 +02:00
committed by GitHub
parent 3d505e425d
commit 789e3e3924
49 changed files with 243 additions and 217 deletions

View File

@@ -128,8 +128,8 @@ class Album {
final Album a = Album(
remoteId: dto.id,
name: dto.albumName,
createdAt: DateTime.parse(dto.createdAt),
modifiedAt: DateTime.parse(dto.updatedAt),
createdAt: dto.createdAt,
modifiedAt: dto.updatedAt,
shared: dto.shared,
);
a.owner.value = await db.users.getById(dto.ownerId);

View File

@@ -22,9 +22,7 @@ class User {
User.fromDto(UserResponseDto dto)
: id = dto.id,
updatedAt = dto.updatedAt != null
? DateTime.parse(dto.updatedAt!).toUtc()
: DateTime.now().toUtc(),
updatedAt = dto.updatedAt,
email = dto.email,
firstName = dto.firstName,
lastName = dto.lastName,