Skip to content

Commit a81c8d9

Browse files
committed
[fix] #79 회원탈퇴 관련 네이밍 변경(signout -> withdraw)
1 parent 6a8fbd7 commit a81c8d9

6 files changed

Lines changed: 20 additions & 20 deletions

File tree

core/data-api/src/main/java/com/neki/android/core/dataapi/repository/AuthRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import com.neki.android.core.model.Auth
55
interface AuthRepository {
66
suspend fun loginWithKakao(idToken: String): Result<Auth>
77
suspend fun updateAccessToken(refreshToken: String): Result<Auth>
8-
suspend fun signOut(): Result<Unit>
8+
suspend fun withdrawAccount(): Result<Unit>
99
}

core/data/src/main/java/com/neki/android/core/data/remote/api/AuthService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AuthService @Inject constructor(
2626
}
2727

2828
// 회원 탈퇴
29-
suspend fun signOut(): BasicNullableResponse<Unit> {
29+
suspend fun withdrawAccount(): BasicNullableResponse<Unit> {
3030
return client.delete("/api/users/me").body()
3131
}
3232
}

core/data/src/main/java/com/neki/android/core/data/repository/impl/AuthRepositoryImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AuthRepositoryImpl @Inject constructor(
2727
).data.toModel()
2828
}
2929

30-
override suspend fun signOut(): Result<Unit> = runSuspendCatching {
31-
authService.signOut()
30+
override suspend fun withdrawAccount(): Result<Unit> = runSuspendCatching {
31+
authService.withdrawAccount()
3232
}
3333
}

feature/mypage/impl/src/main/java/com/neki/android/feature/mypage/impl/main/MyPageContract.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data class MyPageState(
1111
val userInfo: UserInfo = UserInfo(),
1212
val selectedProfileImage: SelectedProfileImage = SelectedProfileImage.NoChange,
1313
val isShowLogoutDialog: Boolean = false,
14-
val isShowSignOutDialog: Boolean = false,
14+
val isShowWithdrawDialog: Boolean = false,
1515
val isShowImageChooseDialog: Boolean = false,
1616
// Permission
1717
val isGrantedCamera: Boolean = false,
@@ -45,9 +45,9 @@ sealed interface MyPageIntent {
4545
data object ClickLogout : MyPageIntent
4646
data object DismissLogoutDialog : MyPageIntent
4747
data object ConfirmLogout : MyPageIntent
48-
data object ClickSignOut : MyPageIntent
49-
data object DismissSignOutDialog : MyPageIntent
50-
data object ConfirmSignOut : MyPageIntent
48+
data object ClickWithdraw : MyPageIntent
49+
data object DismissWithdrawDialog : MyPageIntent
50+
data object ConfirmWithdraw : MyPageIntent
5151

5252
// Permission
5353
data class ClickPermissionItem(val permission: NekiPermission) : MyPageIntent

feature/mypage/impl/src/main/java/com/neki/android/feature/mypage/impl/main/MyPageViewModel.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ internal class MyPageViewModel @Inject constructor(
7575
logout(postSideEffect)
7676
}
7777

78-
MyPageIntent.ClickSignOut -> reduce { copy(isShowSignOutDialog = true) }
79-
MyPageIntent.DismissSignOutDialog -> reduce { copy(isShowSignOutDialog = false) }
80-
MyPageIntent.ConfirmSignOut -> {
81-
reduce { copy(isShowSignOutDialog = false) }
82-
signOut(reduce, postSideEffect)
78+
MyPageIntent.ClickWithdraw -> reduce { copy(isShowWithdrawDialog = true) }
79+
MyPageIntent.DismissWithdrawDialog -> reduce { copy(isShowWithdrawDialog = false) }
80+
MyPageIntent.ConfirmWithdraw -> {
81+
reduce { copy(isShowWithdrawDialog = false) }
82+
withdrawAccount(reduce, postSideEffect)
8383
}
8484

8585
// Permission
@@ -179,12 +179,12 @@ internal class MyPageViewModel @Inject constructor(
179179
postSideEffect(MyPageEffect.NavigateToLogin)
180180
}
181181

182-
private fun signOut(
182+
private fun withdrawAccount(
183183
reduce: (MyPageState.() -> MyPageState) -> Unit,
184184
postSideEffect: (MyPageEffect) -> Unit,
185185
) = viewModelScope.launch {
186186
reduce { copy(isLoading = true) }
187-
authRepository.signOut()
187+
authRepository.withdrawAccount()
188188
.onSuccess {
189189
tokenRepository.clearTokens()
190190
postSideEffect(MyPageEffect.NavigateToLogin)

feature/mypage/impl/src/main/java/com/neki/android/feature/mypage/impl/profile/ProfileSettingScreen.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fun ProfileSettingScreen(
7171
)
7272
SectionItem(
7373
text = "탈퇴하기",
74-
onClick = { onIntent(MyPageIntent.ClickSignOut) },
74+
onClick = { onIntent(MyPageIntent.ClickWithdraw) },
7575
)
7676
}
7777

@@ -88,16 +88,16 @@ fun ProfileSettingScreen(
8888
)
8989
}
9090

91-
if (uiState.isShowSignOutDialog) {
91+
if (uiState.isShowWithdrawDialog) {
9292
DoubleButtonAlertDialog(
9393
title = "정말 탈퇴하시겠어요?",
9494
content = "계정을 탈퇴하면 사진과 정보가 모두 삭제되며,\n삭제된 데이터는 복구할 수 없어요.",
9595
grayButtonText = "취소",
9696
primaryButtonText = "탈퇴 확정",
9797
properties = DialogProperties(usePlatformDefaultWidth = false),
98-
onDismissRequest = { onIntent(MyPageIntent.DismissSignOutDialog) },
99-
onClickGrayButton = { onIntent(MyPageIntent.DismissSignOutDialog) },
100-
onClickPrimaryButton = { onIntent(MyPageIntent.ConfirmSignOut) },
98+
onDismissRequest = { onIntent(MyPageIntent.DismissWithdrawDialog) },
99+
onClickGrayButton = { onIntent(MyPageIntent.DismissWithdrawDialog) },
100+
onClickPrimaryButton = { onIntent(MyPageIntent.ConfirmWithdraw) },
101101
)
102102
}
103103

0 commit comments

Comments
 (0)