Skip to content

Commit e5ad34d

Browse files
authored
Merge pull request #122 from YAPP-Github/BOOK-242-fix/#121
fix: release 환경 약관 동의 화면 버튼 눌렀을 때 응답 없음 해결
2 parents c688ca4 + d98173e commit e5ad34d

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/UserRepository.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package com.ninecraft.booket.core.data.api.repository
22

33
import com.ninecraft.booket.core.model.OnboardingState
4+
import com.ninecraft.booket.core.model.TermsAgreementModel
45
import com.ninecraft.booket.core.model.UserProfileModel
56
import kotlinx.coroutines.flow.Flow
67

78
interface UserRepository {
8-
suspend fun agreeTerms(termsAgreed: Boolean): Result<Unit>
9+
suspend fun agreeTerms(termsAgreed: Boolean): Result<TermsAgreementModel>
910

1011
suspend fun getUserProfile(): Result<UserProfileModel>
1112

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import com.ninecraft.booket.core.model.RecentBookModel
1919
import com.ninecraft.booket.core.model.RecordDetailModel
2020
import com.ninecraft.booket.core.model.RecordRegisterModel
2121
import com.ninecraft.booket.core.model.SeedModel
22+
import com.ninecraft.booket.core.model.TermsAgreementModel
2223
import com.ninecraft.booket.core.model.UserProfileModel
2324
import com.ninecraft.booket.core.network.response.BookDetailResponse
2425
import com.ninecraft.booket.core.network.response.BookSearchResponse
@@ -36,6 +37,7 @@ import com.ninecraft.booket.core.network.response.RecentBook
3637
import com.ninecraft.booket.core.network.response.RecordDetailResponse
3738
import com.ninecraft.booket.core.network.response.RecordRegisterResponse
3839
import com.ninecraft.booket.core.network.response.SeedResponse
40+
import com.ninecraft.booket.core.network.response.TermsAgreementResponse
3941
import com.ninecraft.booket.core.network.response.UserProfileResponse
4042

4143
internal fun UserProfileResponse.toModel(): UserProfileModel {
@@ -236,3 +238,13 @@ internal fun Category.toEmotionModel(): EmotionModel? {
236238
count = count,
237239
)
238240
}
241+
242+
internal fun TermsAgreementResponse.toModel(): TermsAgreementModel {
243+
return TermsAgreementModel(
244+
id = id,
245+
email = email,
246+
nickname = nickname,
247+
provider = provider,
248+
termsAgreed = termsAgreed,
249+
)
250+
}

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultUserRepository.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ internal class DefaultUserRepository @Inject constructor(
1313
private val onboardingDataSource: OnboardingDataSource,
1414
) : UserRepository {
1515
override suspend fun agreeTerms(termsAgreed: Boolean) = runSuspendCatching {
16-
service.agreeTerms(TermsAgreementRequest(termsAgreed))
17-
Unit
16+
service.agreeTerms(TermsAgreementRequest(termsAgreed)).toModel()
1817
}
1918

2019
override suspend fun getUserProfile() = runSuspendCatching {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.ninecraft.booket.core.model
2+
3+
data class TermsAgreementModel(
4+
val id: String,
5+
val email: String,
6+
val nickname: String,
7+
val provider: String,
8+
val termsAgreed: Boolean,
9+
)

0 commit comments

Comments
 (0)