Skip to content

Commit

Permalink
[ Fix ] : 회원탈퇴 기능의 UseCase 명칭 변경
Browse files Browse the repository at this point in the history
- 'Delete' 라는 명칭이 어드민 기능 구현시 혼동을 줄 수 있어, 회원탈퇴를 명확히 나타내는 이름으로 수정합니다.
  • Loading branch information
toastmeister1 committed Nov 25, 2023
1 parent aefe7de commit 344acbf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ import com.yapp.domain.repository.LocalRepository
import com.yapp.domain.repository.MemberRepository
import javax.inject.Inject

class DeleteMemberInfoUseCase @Inject constructor(
/**
* 멤버 **스스로** 회원 탈퇴 기능을 사용할때의 UseCase
*
* 로컬에 저장된 Kakao MemberId를 제거 -> FireStore에 존재하는 데이터를 제거합니다.
*/
class WithdrawMemberInfoUseCase @Inject constructor(
private val localRepository: LocalRepository,
private val memberRepository: MemberRepository,
private val memberRepository: MemberRepository
) {

suspend operator fun invoke(memberId: Long): Result<Boolean> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import com.google.firebase.crashlytics.FirebaseCrashlytics
import com.yapp.common.base.BaseViewModel
import com.yapp.domain.common.KakaoSdkProviderInterface
import com.yapp.domain.model.Team
import com.yapp.domain.model.types.TeamType
import com.yapp.domain.usecases.DeleteMemberInfoUseCase
import com.yapp.domain.usecases.WithdrawMemberInfoUseCase
import com.yapp.domain.usecases.GetConfigUseCase
import com.yapp.domain.usecases.GetCurrentMemberInfoUseCase
import com.yapp.domain.usecases.GetMemberIdUseCase
Expand All @@ -20,7 +19,7 @@ class MemberSettingViewModel @Inject constructor(
private val kakaoSdkProvider: KakaoSdkProviderInterface,
private val getMemberIdUseCase: GetMemberIdUseCase,
private val getCurrentMemberInfoUseCase: GetCurrentMemberInfoUseCase,
private val deleteMemberInfoUseCase: DeleteMemberInfoUseCase,
private val withdrawMemberInfoUseCase: WithdrawMemberInfoUseCase,
private val getConfigUseCase: GetConfigUseCase,
private val shouldShowGuestButtonUseCase: ShouldShowGuestButtonUseCase,
) :
Expand Down Expand Up @@ -82,7 +81,7 @@ class MemberSettingViewModel @Inject constructor(
.onSuccess { memberId ->
require(memberId != null)

deleteMemberInfoUseCase(memberId).getOrDefault(defaultValue = false).also { isSuccess ->
withdrawMemberInfoUseCase(memberId).getOrDefault(defaultValue = false).also { isSuccess ->
if (!isSuccess) {
setState { copy(loadState = MemberSettingContract.LoadState.Idle) }
setEffect(MemberSettingContract.MemberSettingUiSideEffect.ShowToast)
Expand Down Expand Up @@ -141,7 +140,7 @@ class MemberSettingViewModel @Inject constructor(
getMemberIdUseCase()
.onSuccess { memberId ->
require(memberId != null)
deleteMemberInfoUseCase(memberId).getOrDefault(false).also { isSuccess ->
withdrawMemberInfoUseCase(memberId).getOrDefault(false).also { isSuccess ->
if (!isSuccess) {
setState { copy(loadState = MemberSettingContract.LoadState.Idle) }
setEffect(MemberSettingContract.MemberSettingUiSideEffect.ShowToast)
Expand Down

0 comments on commit 344acbf

Please sign in to comment.