Skip to content

Commit

Permalink
[FIX/#119] 회원가입 API에서 마케팅 정보 전달
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchbreeze committed Sep 7, 2024
1 parent af7b655 commit 53e1da2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ data class SignUpRequestDto(
val birth: String,
@SerialName("sex")
val sex: String,
@SerialName("isAgreedMarketingTerm")
val isAgreedMarketingTerm: Boolean,
) {
companion object {
fun SignUpRequestModel.toDto() = SignUpRequestDto(name, phone, birth, sex)
fun SignUpRequestModel.toDto() = SignUpRequestDto(name, phone, birth, sex, isAgreedMarketingTerm)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ data class SignUpRequestModel(
val phone: String,
val birth: String,
val sex: String,
val isAgreedMarketingTerm: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,16 @@ class PhoneViewModel
_getIamportCertificationResult.emit(true)
postToSignUpFromServer(
SignUpRequestModel(
it.name.orEmpty(),
it.phone.orEmpty(),
it.birthday.orEmpty(),
it.gender?.uppercase().orEmpty(),
name = it.name.orEmpty(),
phone = it.phone.orEmpty(),
birth = it.birthday.orEmpty(),
sex = it.gender?.uppercase().orEmpty(),
isAgreedMarketingTerm = isTermMarketingSelected.value ?: false,
),
)
userRepository.setUserInfo(
it.name.orEmpty(),
it.phone?.toPhoneFrom().orEmpty(),
userName = it.name.orEmpty(),
userPhone = it.phone?.toPhoneFrom().orEmpty(),
)
} else {
_getIamportCertificationResult.emit(false)
Expand Down

0 comments on commit 53e1da2

Please sign in to comment.