Skip to content

Commit

Permalink
♻️ 指摘箇所の修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsutakein committed Dec 12, 2023
1 parent e1bd891 commit 8127097
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public interface PlaceDao {
public fun placesStream(placeIds: List<String>): Flow<List<Place>>

/**
* スケジュール一覧を登録 / 更新する
* 場所一覧を登録 / 更新する
*/
public fun upsert(entities: List<Place>)

/**
* スケジュールを登録 / 更新する
* 場所を登録 / 更新する
*/
public fun upsert(entity: Place)
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ internal class SqlDelightPlaceDao(
override fun upsert(entities: List<Place>) {
database.transaction {
for (entity in entities) {
upsertUserProfile(entity)
upsertPlace(entity)
}
}
}

override fun upsert(entity: Place) {
database.transaction {
upsertUserProfile(entity)
upsertPlace(entity)
}
}

private fun upsertUserProfile(entity: Place) {
private fun upsertPlace(entity: Place) {
database.placesQueries.upsert(
id = entity.id,
name = entity.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ internal class SqlDelightScheduleDao(
override fun upsert(entities: List<Schedule>) {
database.transaction {
for (entity in entities) {
upsertUserProfile(entity)
upsertSchedule(entity)
}
}
}

override fun upsert(entity: Schedule) {
database.transaction {
upsertUserProfile(entity)
upsertSchedule(entity)
}
}

private fun upsertUserProfile(entity: Schedule) {
private fun upsertSchedule(entity: Schedule) {
database.schedulesQueries.upsert(
id = entity.id,
scheduled_at = entity.scheduledAt,
Expand Down

0 comments on commit 8127097

Please sign in to comment.