Skip to content

Commit

Permalink
chore: rename dao insert Method
Browse files Browse the repository at this point in the history
  • Loading branch information
murjune committed Jan 23, 2025
1 parent c28453b commit 2ab8f88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GoalDaoTest {
val goals: List<GoalEntity> = fakeGoalEntities("준원", "준혁")

// when
goalDao.saveGoals(goals)
goalDao.insertGoals(goals)

// then
val retrievedGoals: List<GoalEntity> = goalDao.getGoals().first()
Expand All @@ -49,7 +49,7 @@ class GoalDaoTest {
val goal: GoalEntity = fakeGoalEntity(id = 1L, title = "준원")

// when
goalDao.saveGoal(goal)
goalDao.insertGoal(goal)
goalDao.deleteGoal(goalId = 1L)
// then
val retrievedGoals: List<GoalEntity> = goalDao.getGoals().first()
Expand All @@ -62,7 +62,7 @@ class GoalDaoTest {
// given
val goal: GoalEntity = fakeGoalEntity(id = 1L, title = "준원", state = Goal.State.Todo)
// when
goalDao.saveGoal(goal)
goalDao.insertGoal(goal)
goalDao.updateGoal(goal.copy(state = Goal.State.Done))
// then
val retrievedGoal: GoalEntity = goalDao.getGoal(1L).first()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ interface GoalDao {
fun getGoal(id: Long): Flow<GoalEntity>

@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun saveGoal(goals: GoalEntity)
suspend fun insertGoal(goals: GoalEntity)

@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun saveGoals(goals: List<GoalEntity>)
suspend fun insertGoals(goals: List<GoalEntity>)

@Query("DELETE FROM Goal WHERE id = :goalId")
suspend fun deleteGoal(goalId: Long)
Expand Down

0 comments on commit 2ab8f88

Please sign in to comment.