Skip to content

Commit a4e9670

Browse files
committed
FIX: 루틴 작성/수정 API 요청 관련 날짜 String 형식 수정 및 빈 서브루틴 이름은 요청에 미포함되도록 수정
1 parent cced6a1 commit a4e9670

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

  • domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/model
  • presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine

domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/model/Date.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ data class Date(
1212
}
1313

1414
fun toFormattedString(): String {
15-
return "%04d.%02d.%02d".format(year, month, day)
15+
return "%04d-%02d-%02d".format(year, month, day)
1616
}
1717
}

presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ class WriteRoutineViewModel @AssistedInject constructor(
463463
when (val writeRoutineType = currentState.writeRoutineType) {
464464
WriteRoutineType.Add -> {
465465
sendIntent(WriteRoutineIntent.RegisterRoutineLoading)
466-
val subRoutines = if (currentState.selectNotUseSUbRoutines) emptyList() else currentState.subRoutineNames
466+
val subRoutines = if (currentState.selectNotUseSUbRoutines) emptyList() else currentState.subRoutineNames.filter { it.isNotEmpty() }
467467

468468
val registerRoutineResult = registerRoutineUseCase(
469469
name = currentState.routineName,
@@ -482,7 +482,7 @@ class WriteRoutineViewModel @AssistedInject constructor(
482482
}
483483
is WriteRoutineType.Edit -> {
484484
val currentRoutineId = routineId ?: return@launch
485-
val subRoutines = if (currentState.selectNotUseSUbRoutines) emptyList() else currentState.subRoutineNames
485+
val subRoutines = if (currentState.selectNotUseSUbRoutines) emptyList() else currentState.subRoutineNames.filter { it.isNotEmpty() }
486486
val routineUpdateType = if (writeRoutineType.updateRoutineFromNowDate) {
487487
RoutineUpdateType.Today
488488
} else {

0 commit comments

Comments
 (0)