Skip to content

Commit c0ab8f9

Browse files
committed
Fix: 루틴 삭제 시 routineType을 함께 전달하도록 수정
- RoutineByDayDeletion, RoutineByDayDeletionRequestDto에 routineType 필드 추가
1 parent 0036400 commit c0ab8f9

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

data/src/main/java/com/threegap/bitnagil/data/routine/model/request/RoutineByDayDeletionRequestDto.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ data class RoutineByDayDeletionRequestDto(
1010
val routineCompletionId: Int?,
1111
@SerialName("routineId")
1212
val routineId: String,
13+
@SerialName("routineType")
14+
val routineType: String,
1315
@SerialName("subRoutineInfosForDelete")
1416
val subRoutineInfosForDelete: List<SubRoutineDeletionInfoDto>,
1517
@SerialName("performedDate")
@@ -22,6 +24,7 @@ fun RoutineByDayDeletion.toDto() =
2224
RoutineByDayDeletionRequestDto(
2325
routineCompletionId = this.routineCompletionId,
2426
routineId = this.routineId,
27+
routineType = this.routineType.name,
2528
subRoutineInfosForDelete = this.subRoutineInfosForDelete.map { it.toDto() },
2629
performedDate = this.performedDate,
2730
historySeq = this.historySeq,

domain/src/main/java/com/threegap/bitnagil/domain/routine/model/RoutineByDayDeletion.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.threegap.bitnagil.domain.routine.model
33
data class RoutineByDayDeletion(
44
val routineCompletionId: Int?,
55
val routineId: String,
6+
val routineType: RoutineType,
67
val subRoutineInfosForDelete: List<SubRoutineDeletionInfo>,
78
val performedDate: String,
89
val historySeq: Int,

presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fun HomeScreenContainer(
9595
onEdit = { viewModel.sendIntent(HomeIntent.NavigateToEditRoutine(routine.routineId)) },
9696
onDelete = {
9797
if (routine.repeatDay.isEmpty()) {
98-
viewModel.deleteRoutine(routine.routineId)
98+
viewModel.deleteRoutineByDay(routine)
9999
} else {
100100
viewModel.sendIntent(HomeIntent.ShowDeleteConfirmDialog(routine))
101101
}

presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/RoutineUiModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ fun RoutineUiModel.toRoutineByDayDeletion(performedDate: String): RoutineByDayDe
3939
RoutineByDayDeletion(
4040
routineCompletionId = this.routineCompletionId,
4141
routineId = this.routineId,
42+
routineType = this.routineType,
4243
subRoutineInfosForDelete = this.subRoutines.map { it.toSubRoutineDeletionInfo() },
4344
performedDate = performedDate,
4445
historySeq = this.historySeq,

0 commit comments

Comments
 (0)