Simplify DTO creation

This commit is contained in:
Reinhard Prechtl 2017-06-09 18:14:17 +02:00
parent 7fc151f1bf
commit 1a368d360c

View file

@ -57,7 +57,7 @@ internal data class CityEntity(
id = defaultCity.id!!,
name = dto.name ?: defaultCity.name,
description = dto.description ?: defaultCity.description,
location = if (dto.location != null) Coordinate(dto.location.longitude, dto.location.latitude) else defaultCity.location,
location = if (dto.location != null) Coordinate.fromDto(dto.location) else defaultCity.location,
updatedAt = LocalDateTime.now(),
createdAt = defaultCity.createdAt)