Skip to content

Commit b3b6038

Browse files
committed
FIX: 회원탈퇴 수정
1 parent 732cff9 commit b3b6038

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

core/data/src/main/java/com/plottwist/core/data/auth/repository/AuthRepositoryImpl.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.plottwist.core.domain.push.repository.PushRepository
66
import com.plottwist.core.network.model.auth.DeviceInfo
77
import com.plottwist.core.network.model.auth.GoogleLoginRequest
88
import com.plottwist.core.network.service.AuthApiService
9+
import com.plottwist.core.network.service.TukApiService
910
import com.plottwist.core.preference.datasource.AuthDataSource
1011
import kotlinx.coroutines.flow.Flow
1112
import kotlinx.coroutines.flow.collect
@@ -18,7 +19,8 @@ class AuthRepositoryImpl @Inject constructor(
1819
private val authApiService: AuthApiService,
1920
private val authDataSource: AuthDataSource,
2021
private val deviceInfoProvider: DeviceInfoProvider,
21-
private val pushRepository: PushRepository
22+
private val pushRepository: PushRepository,
23+
private val tukApiService: TukApiService
2224
) : AuthRepository {
2325

2426
override suspend fun googleLogin(accountId: String): Result<Boolean> {
@@ -75,10 +77,10 @@ class AuthRepositoryImpl @Inject constructor(
7577

7678
override suspend fun deleteAccount(): Result<Boolean> {
7779
return try {
78-
val response = authApiService.deleteMember()
80+
val response = tukApiService.deleteMember()
7981

8082
if (response.success) {
81-
authDataSource.clear()
83+
authDataSource.clear().collect()
8284
Result.success(true)
8385
} else {
8486
Result.failure(Exception("Fail Delete member"))
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package com.plottwist.core.network.model.auth
22

3-
data class LogoutResponse(
3+
import kotlinx.serialization.Serializable
4+
5+
@Serializable
6+
data class DeleteMemberResponse(
47
val success: Boolean,
5-
val meta: Meta
6-
) {
7-
data class Meta(
8-
val errorType: String,
9-
val errorMessage: String
10-
)
11-
}
8+
val meta: Meta?
9+
)
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
package com.plottwist.core.network.service
22

33
import com.plottwist.core.network.model.auth.GoogleLoginRequest
4-
import com.plottwist.core.network.model.auth.JoinGatheringResponse
54
import com.plottwist.core.network.model.auth.LoginResponse
6-
import com.plottwist.core.network.model.auth.LogoutResponse
75
import retrofit2.http.Body
8-
import retrofit2.http.DELETE
96
import retrofit2.http.POST
10-
import retrofit2.http.Path
117

128
interface AuthApiService {
139
@POST("/api/v1/auth/login/google")
1410
suspend fun googleLogin(
1511
@Body googleLoginRequest: GoogleLoginRequest
1612
): LoginResponse
17-
18-
@DELETE("/api/v1/members")
19-
suspend fun deleteMember(): LogoutResponse
2013
}

core/network/src/main/java/com/plottwist/core/network/service/TukApiService.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.plottwist.core.network.service
22

3+
import com.plottwist.core.network.model.auth.DeleteMemberResponse
34
import com.plottwist.core.network.model.auth.GetGatheringNameResponse
45
import com.plottwist.core.network.model.auth.JoinGatheringResponse
56
import com.plottwist.core.network.model.gathering.CreateGatheringRequest
@@ -14,6 +15,7 @@ import com.plottwist.core.network.model.gathering.UpdateGatheringRequest
1415
import com.plottwist.core.network.model.gathering.UpdateGatheringResponse
1516
import retrofit2.Response
1617
import retrofit2.http.Body
18+
import retrofit2.http.DELETE
1719
import retrofit2.http.GET
1820
import retrofit2.http.PATCH
1921
import retrofit2.http.POST
@@ -60,4 +62,7 @@ interface TukApiService {
6062
@Path("gatheringId") gatheringId: Long?,
6163
@Body updateGatheringRequest : UpdateGatheringRequest
6264
): UpdateGatheringResponse
65+
66+
@DELETE("/api/v1/members")
67+
suspend fun deleteMember(): DeleteMemberResponse
6368
}

0 commit comments

Comments
 (0)