-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 회원탈퇴 기능 구현 #16 #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5b918f5
Feat: #16 계정 탈퇴 API 연동 코드 구현
ProtossManse 33107d8
Update ApiModule.kt
ProtossManse 3dde3b8
Merge branch 'develop' of https://github.com/Medicare-Call/Medicare-C…
ProtossManse e6a1973
Merge branch 'develop' of https://github.com/Medicare-Call/Medicare-C…
ProtossManse 2df2b63
Feat: #16 탈퇴 시 로그아웃되게끔 구현
ProtossManse e13531a
Fix: #16 api 요청 url 오류 수정
ProtossManse 580decb
Update MemberDeleteRepositoryImpl.kt
ProtossManse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...eApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api/member/MemberDeleteService.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.konkuk.medicarecall.data.api.member | ||
|
|
||
| import de.jensklingenberg.ktorfit.Response | ||
| import de.jensklingenberg.ktorfit.http.DELETE | ||
|
|
||
| interface MemberDeleteService { | ||
| @DELETE("member") | ||
| suspend fun deleteMember(): Response<Unit> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...p/src/commonMain/kotlin/com/konkuk/medicarecall/data/repository/MemberDeleteRepository.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.konkuk.medicarecall.data.repository | ||
|
|
||
| interface MemberDeleteRepository { | ||
| suspend fun deleteMember(): Result<Unit> | ||
| } |
15 changes: 15 additions & 0 deletions
15
...mmonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/MemberDeleteRepositoryImpl.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package com.konkuk.medicarecall.data.repositoryimpl | ||
|
|
||
| import com.konkuk.medicarecall.data.api.member.MemberDeleteService | ||
| import com.konkuk.medicarecall.data.repository.MemberDeleteRepository | ||
| import com.konkuk.medicarecall.data.util.handleNullableResponse | ||
| import org.koin.core.annotation.Single | ||
|
|
||
| @Single | ||
| class MemberDeleteRepositoryImpl( | ||
| private val memberDeleteService: MemberDeleteService, | ||
| ) : MemberDeleteRepository { | ||
| override suspend fun deleteMember(): Result<Unit> = runCatching { | ||
| memberDeleteService.deleteMember().handleNullableResponse() | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,23 +27,22 @@ import androidx.compose.ui.Alignment | |
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.clip | ||
| import androidx.compose.ui.graphics.Color | ||
| import org.jetbrains.compose.resources.painterResource | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.lifecycle.Lifecycle | ||
| import androidx.lifecycle.LifecycleEventObserver | ||
| import androidx.lifecycle.compose.LocalLifecycleOwner | ||
| import androidx.lifecycle.compose.collectAsStateWithLifecycle | ||
| import com.konkuk.medicarecall.domain.model.type.GenderType | ||
| import com.konkuk.medicarecall.resources.Res | ||
| import com.konkuk.medicarecall.resources.* | ||
| import com.konkuk.medicarecall.resources.ic_settings_back | ||
| import com.konkuk.medicarecall.ui.common.util.formatDateToKorean | ||
| import com.konkuk.medicarecall.ui.feature.settings.mydata.component.LogoutConfirmDialog | ||
| import com.konkuk.medicarecall.ui.feature.settings.component.SettingInfoItem | ||
| import com.konkuk.medicarecall.ui.feature.settings.component.SettingsTopAppBar | ||
| import com.konkuk.medicarecall.ui.feature.settings.mydata.component.LogoutConfirmDialog | ||
| import com.konkuk.medicarecall.ui.feature.settings.mydata.viewmodel.SettingsMyDataViewModel | ||
| import com.konkuk.medicarecall.ui.theme.MediCareCallTheme | ||
| import com.konkuk.medicarecall.ui.theme.figmaShadow | ||
| import com.konkuk.medicarecall.domain.model.type.GenderType | ||
| import org.jetbrains.compose.resources.painterResource | ||
| import org.koin.compose.viewmodel.koinViewModel | ||
|
|
||
| @Composable | ||
|
|
@@ -78,7 +77,21 @@ fun SettingsMyDataScreen( | |
| onBackClick = onBack, | ||
| onEditClick = navigateToUserInfoSetting, | ||
| onLogoutClick = { showLogoutDialog = true }, | ||
| onServiceWithdrawClick = {}, | ||
| onServiceWithdrawClick = { | ||
| viewModel.deleteUser( | ||
| onSuccess = { | ||
| viewModel.logout( | ||
| onSuccess = { | ||
| showLogoutDialog = false | ||
| navigateToLoginAfterLogout() | ||
| }, | ||
| onError = { error -> | ||
| }, | ||
| ) | ||
| }, | ||
| onError = {}, | ||
| ) | ||
|
Comment on lines
+80
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 실패 콜백이 비어 있어 탈퇴/로그아웃 실패 시 사용자 흐름이 끊깁니다. Line 88-89, Line 92에서 🩹 최소 보완안 onServiceWithdrawClick = {
viewModel.deleteUser(
onSuccess = {
viewModel.logout(
onSuccess = {
showLogoutDialog = false
navigateToLoginAfterLogout()
},
- onError = { error ->
- },
+ onError = { _ ->
+ // 로컬 세션 정리 상태와 UI 상태를 맞춤
+ showLogoutDialog = false
+ navigateToLoginAfterLogout()
+ },
)
},
- onError = {},
+ onError = { _ ->
+ // TODO: 스낵바/다이얼로그 등 사용자 피드백 연결
+ },
)
},🤖 Prompt for AI Agents |
||
| }, | ||
| onLogoutDismiss = { showLogoutDialog = false }, | ||
| onLogoutConfirm = { | ||
| viewModel.logout( | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.