diff --git a/data/src/main/java/com/terning/data/datasource/MyPageDataSource.kt b/data/src/main/java/com/terning/data/datasource/MyPageDataSource.kt index c543a9ac5..aec35848d 100644 --- a/data/src/main/java/com/terning/data/datasource/MyPageDataSource.kt +++ b/data/src/main/java/com/terning/data/datasource/MyPageDataSource.kt @@ -3,5 +3,5 @@ package com.terning.data.datasource import com.terning.data.dto.NonDataBaseResponse interface MyPageDataSource { - suspend fun patchLogout(): NonDataBaseResponse + suspend fun postLogout(): NonDataBaseResponse } \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt b/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt index a635ce12f..97a3c5ae9 100644 --- a/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt +++ b/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt @@ -8,5 +8,5 @@ import javax.inject.Inject class MyPageDataSourceImpl @Inject constructor( private val myPageService: MyPageService ) : MyPageDataSource { - override suspend fun patchLogout(): NonDataBaseResponse = myPageService.patchLogout() + override suspend fun postLogout(): NonDataBaseResponse = myPageService.patchLogout() } \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt index 4b161b4f6..580294a1d 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt @@ -7,8 +7,8 @@ import javax.inject.Inject class MyPageRepositoryImpl @Inject constructor( private val myPageDataSource: MyPageDataSource ) : MyPageRepository { - override suspend fun patchLogout(): Result = + override suspend fun postLogout(): Result = runCatching { - myPageDataSource.patchLogout() + myPageDataSource.postLogout() } } \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/service/MyPageService.kt b/data/src/main/java/com/terning/data/service/MyPageService.kt index 464814e07..9c73cd98c 100644 --- a/data/src/main/java/com/terning/data/service/MyPageService.kt +++ b/data/src/main/java/com/terning/data/service/MyPageService.kt @@ -5,6 +5,5 @@ import retrofit2.http.POST interface MyPageService { @POST("api/v1/auth/logout") - suspend fun patchLogout(): NonDataBaseResponse - + suspend fun postLogout(): NonDataBaseResponse } \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt b/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt index c4cebf922..3e2ac65c7 100644 --- a/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt @@ -1,5 +1,5 @@ package com.terning.domain.repository interface MyPageRepository { - suspend fun patchLogout() : Result + suspend fun postLogout() : Result } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt index 96b10be01..fdcbf8c50 100644 --- a/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt @@ -31,16 +31,16 @@ class MyPageViewModel @Inject constructor( fun logoutKakao() { UserApiClient.instance.logout { error -> if (error == null) { - patchLogout() + postLogout() } else { _state.value = _state.value.copy(isSuccess = UiState.Failure(error.toString())) } } } - private fun patchLogout() { + private fun postLogout() { viewModelScope.launch { - myPageRepository.patchLogout().onSuccess { + myPageRepository.postLogout().onSuccess { tokenRepository.clearInfo() _state.value = _state.value.copy(isSuccess = UiState.Success(true)) }.onFailure {