diff --git a/piikii-output-persistence/postgresql/src/main/kotlin/com/piikii/output/persistence/postgresql/adapter/PlaceAdapter.kt b/piikii-output-persistence/postgresql/src/main/kotlin/com/piikii/output/persistence/postgresql/adapter/PlaceAdapter.kt index 2b4cb971..7eae93f2 100644 --- a/piikii-output-persistence/postgresql/src/main/kotlin/com/piikii/output/persistence/postgresql/adapter/PlaceAdapter.kt +++ b/piikii-output-persistence/postgresql/src/main/kotlin/com/piikii/output/persistence/postgresql/adapter/PlaceAdapter.kt @@ -27,7 +27,7 @@ class PlaceAdapter( val placeEntity = PlaceEntity( roomUid = roomUid, - scheduleId = scheduleId, + scheduleId = place.id, place = place, ) return placeRepository.save(placeEntity).toDomain() @@ -39,11 +39,11 @@ class PlaceAdapter( places: List, ): List { val placeEntities = - places.zip(scheduleIds) { place, scheduleId -> + places.map { PlaceEntity( roomUid = roomUid, - scheduleId = scheduleId, - place = place, + scheduleId = it.id, + place = it, ) } return placeRepository.saveAll(placeEntities).map { it.toDomain() }